File: poisson.gee.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 (39 lines) | stat: -rw-r--r-- 795 bytes parent folder | download | duplicates (4)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#####  Example 1: Basic Example #####

# Attach sample data and variable names:  
data(sanction)

#  Variable identifying clusters
sanction$cluster <- c(rep(c(1:15),5),rep(c(16),3))

# Sorting by cluster
sorted.sanction <- sanction[order(sanction$cluster),]

# Estimate model and present a summary:
user.prompt()
z.out <- zelig(num ~ target + coop, model = "poisson.gee", id = "cluster", data = sorted.sanction, robust=TRUE, corstr="exchangeable")
user.prompt()
summary(z.out)

# Set explanatory variables to their default values:
user.prompt()
x.out <- setx(z.out)

# Simulate quantities of interest
user.prompt()
s.out <- sim(z.out, x = x.out)
user.prompt()
summary(s.out)

# Generate a plot of quantities of interest:
user.prompt()
plot(s.out)