Hillard, thank you that worked.
require(utils)
attach(CatchCR.df)
The following object(s) are masked from CatchCR.df ( position 3
) :
A..V. Allur. Allur.Prop AllurCatch Attract Food Light Orient
Run Tot.Caught Tot.Caught.Prop Victor. VictorCatch
I've looked at the documentation for 'attach', and didn't see any
clues
about zelig's need for this function( isn't zelig somehow calling glm?),
but didn't need attach if using the glm function directly (no doubt
this description is mangling the real workings of glm vs. zelig). If
you have time, could you explain why attach is needed for zelig's glm,
but not for glm directly? I'd like to understand when to use 'attach'
in the future.
Thanks again, Paul
________________________________
From: Hillard Pouncy [mailto:hillard.pouncy@gmail.com]
Sent: Tuesday, February 24, 2009 3:34 PM
To: Prew, Paul
Subject: Re: [zelig] Help with having zelig recognize my data?
try an >attach(CatchCR.df) command
Hillard Pouncy
On Tue, Feb 24, 2009 at 4:10 PM, Prew, Paul
<Paul.Prew(a)ecolab.com> wrote:
Hello, I am still very inexperienced with Zelig. I
hope you can help me with a question that I have not been able to
resolve from reading the documentation.
I'm attempting a basic binomial logit model, using data
that has already been analyzed via the 'glm' package. I would like to
see how the zelig simulation output can augment the results.
I'm just doing a cut&paste with my objects in the place
of the example objects from the documentation:
++++++ Documentation Example for logit +++++++
# Unconditional prediction:
data(turnout)
z.out <- zelig(vote ~ race + educate, model =
"logit", data = turnout)
x.out <- setx(z.out)
s.out <- sim(z.out, x = x.out)
++++++ My Attempt +++++++
data(CatchCR.df)
Warning message:
In data(CatchCR.df) : data set 'CatchCR.df' not found
ls()
[1] "Allur.glm"
"Allur.Int" "Allur.mod"
"CatchCR.df"
str(CatchCR.df)
'data.frame': 20
obs. of 13 variables:
$ Run : num 1 2 3 4 5 6 7 8 9 10 ...
$ Food : Factor w/ 2 levels "Fed","Starved":
2 1 2 1 2 1 2 1 1 1 ...
$ Attract : Factor w/ 2 levels "No","Yes": 2 2 2
2 2 1 1 1 1 2 ...
$ Orient : Factor w/ 2 levels
"Challenged","Open": 2 2 1 1 1 2 2 1 2 1 ...
$ Light : Factor w/ 2 levels "Off","On": 1 1 1
1 1 1 1 1 1 1 ...
$ Allur. : num 45 50 15 20 20 45 25 25 30 15
...
$ Victor. : num 40 40 85 65 70 35 55 55 60 55
...
$ A..V. : num 1.125 1.25 0.176 0.308 0.286
...
$ AllurCatch : num 9 10 3 4 4 9 5 5 6 3 ...
$ VictorCatch : num 8 8 17 13 14 7 11 11 12 11 ...
$ Allur.Prop : num 0.45 0.5 0.15 0.2 0.2 0.45 0.25
0.25 0.3 0.15 ...
$ Tot.Caught : num 17 18 20 17 18 16 16 16 18 14
...
$ Tot.Caught.Prop: num 0.85 0.9 1 0.85 0.9 0.8 0.8 0.8
0.9 0.7 ...
++++++ Ran glm immediately after without a problem
+++++++
Allur.Int<-glm(CatchCR.df$Allur.Prop~(Food+Attract+Orient+Light)^2,
family=binomial, data = CatchCR.df)
Any help is greatly appreciated, thanks, Paul
CONFIDENTIALITY NOTICE:
This e-mail communication and any attachments may contain proprietary and privileged
information for the use of the designated recipients named above.
Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.