File: lognorm.R

package info (click to toggle)
zelig 3.3-1-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 30,800 kB
  • ctags: 470
  • sloc: sh: 81; makefile: 10
file content (25 lines) | stat: -rw-r--r-- 658 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Load the sample data:  
data(coalition)

# Estimate the model:
user.prompt()
z.out <- zelig(Surv(duration, ciep12) ~ fract + numst2, model = "lognorm",
               data = coalition)
user.prompt()
# View the regression output:  
summary(z.out)

# Set the baseline values (with the ruling coalition in the minority)
# and the alternative values (with the ruling coalition in the majority)
# for X:
user.prompt()
x.low <- setx(z.out, numst2 = 0)
x.high <- setx(z.out, numst2 = 1)

# Simulate expected values qi$ev and first differences qi$fd:
user.prompt()
s.out <- sim(z.out, x = x.low, x1 = x.high)
user.prompt()
summary(s.out)
user.prompt()
plot(s.out)