Hi, Taun.
The problem is in the way you are reading in the data. Whenever you use SPSS data, you
need to use:
testo <- read.spss("testo.sav", to.data.frame = TRUE)
Otherwise your data will be a list, not a data frame, and zelig() will get confused.
Also, I would avoid attach() whenever possible -- you don't need it here, and so
it's just another thing that will confuse R.
Best,
Olivia Lau
----- Original Message -----
From: Tuan V. Nguyen
To: 'Olivia Lau'
Sent: Wednesday, March 15, 2006 6:14 PM
Subject: RE: [zelig] Help in Zelig: "subscript out of bound"
Dear Olivia,
The data are actually in SPSS (see attached). I want to try the Zelig program, so I
thought this is my ideal chance. The Zelig package I current use is the latest one
(version March 9, 2006) which I have just downloaded.
My sequence of commands are as follows:
library(foreign)
testo<-read.spss("testo.sav")
attach(testo)
Library(Zelig)
zout<-zelig(ALLNEWFX~TT1+ LSBMD1,model="logit",data=testo)
summary(zout)
Thank you for having a look at this, Olivia.
Tuan
-----Original Message-----
From: Olivia Lau [mailto:olau@fas.harvard.edu]
Sent: Thursday, 16 March 2006 10:07 AM
To: Tuan V. Nguyen
Subject: Re: [zelig] Help in Zelig: "subscript out of bound"
Dear Tuan,
What version of Zelig are you using? And could you send me your data? That's a
very strange error. Thanks, Olivia
----- Original Message -----
From: Tuan V. Nguyen
To: zelig(a)mail-1.hmdc.harvard.edu
Sent: Wednesday, March 15, 2006 6:07 PM
Subject: [zelig] Help in Zelig: "subscript out of bound"
Dear list members,
I am a new chap in this list. I am also a new user of Zelig. May I take this
opportunity to ask a simple question.
I am trying to run a logistic regression model on my data, which -- for brevity -- has
three variables: ALLNEWFX is a two-value variable (0 or 1), TT1 and LSBMD1 are continuous
variables. The dataset contain 609 observations.
The model I used was:
zout <- zelig(ALLNEWFX ~TT1+LSBMD1
,model="logit",data=testo)
but then when I ask for a summary, I have the following message:
summary(zout)
Error in object[[i]] : subscript out of bounds
I am not sure what does this messgae mean. Could someone please help? Thank you in
advance for your help.
Regards,
Tuan
Dr Tuan V. Nguyen
Bone and Mineral Research Program
Garvan Institute of Medical Research
384 Victoria Street
Darlinghurst, NSW 2010 Australia
Phone: +612 9295 8277
Fax: +612 9295 8241