Rachel,
I think you need the variance-covariance matrix as the argument to Sigma rather than the
standard errors.
Colin
From: gov2001-l-bounces(a)lists.fas.harvard.edu
[mailto:gov2001-l-bounces@lists.fas.harvard.edu] On Behalf Of Rachel Crouch
Sent: Monday, April 11, 2011 5:48 PM
To: 'Class List for Gov 2001/E-2001'
Subject: [gov2001] Incompatible arguments in R
Hi team,
Maybe someone has run across this? When I try to draw from mvrnorm, R gives me an
"incompatible arguments" error. I thought I would send it out to the list
before spinning my wheels any longer. The code is below (the first half or so is just for
context).
Let me know if you have any thoughts. Thanks!
Rachel
#Logit model:
z.out.1 <- zelig(REVERSAL ~ TREND.2d + TREND.9th +
TRANS.2d.v1 + CHANGEt.2d.v1 +
FLOOD.2d.v1 + CHANGEf.2d.v1 +
TRANS.9th.v1 + CHANGEt.9th.v1 +
FLOOD.9th.v1 + CHANGEf.9th.v1 +
factor(JUDGQY) + factor(CIRCUIT) + GOP + DCTGOP +
VACANCY,
model = "logit", data = caselevel.data.logit)
#Robust standard errors:
temp.lrm <-lrm(z.out.1, x=TRUE, y=TRUE, data=caselevel.data.logit)
g1 <- robcov(temp.lrm, caselevel.data.logit$CIRCUIT)
#Simulating:
se1 <- sqrt(diag(g1$var))
coef1 <- z.out.1$coef
se1 <- as.matrix(se1)
coef1 <- as.matrix(coef1)
set.seed(02138)
betas <- mvrnorm(n = 5000, mu = coef1, Sigma = se1)
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l