On Feb 9, 2011, at 04:16 , maxsilva wrote:

> 
> Thank you for your kindness, but ive done what you've said and the problem
> remains.  What im doing is pretty straightforward, 
> 

...

>> model<-glm(data$response~data$pred1+datos$pred2,
> family=binomial(link="logit"))

Just in case what Dennis said didn't take: The above is your problem. You need 
to setup a model formula that applies both within "data" and "sdata", so drop 
the data$ prefix

glm(response ~ pred2 + pred2, data=data)

otherwise, predict() goes looking for data$pred1 etc. and finds the same ones 
that got used in the model.

... and of course, they have the wrong length:

> 
>> pred<- predict(model, newdata=sdata,type="response")
> Mensajes de aviso perdidos
> 'newdata' had 5 rows but variable(s) found have 10 rows 

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd....@cbs.dk  Priv: pda...@gmail.com

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to