[R] logistic regression - using polys and products of features

ronggui 0034058 at fudan.edu.cn
Fri Jun 17 19:05:51 CEST 2005


On Fri, 17 Jun 2005 07:39:30 +1000
Stephen Choularton <mail at bymouth.com> wrote:

> Hi
>  
> I can get all my features by doing this:
>  
> > logistic.model = glm(similarity ~ ., family=binomial, data =
> cData[3001:3800,])
>  
>  
> I can get the product of all my features by this:
>  
> logistic.model = glm(similarity ~ . ^ 2,  family=binomial, data =
> cData[3001:3800,])
>  
> I don't seem to be able to get polys by doing this:
>  
> logistic.model = glm(similarity ~ poly(.,2), family=binomial, data =
> cData[3001:3800,])
> Error in poly(., 2) : Object "." not found
> >
>  
> How can I get polys?
>  
> What do the warnings mean  when I  do this:
>  
> > logistic.model = glm(similarity ~ . + . ^ 2, family=binomial, data =
> cData[3001:3800,])
> Warning messages: 
> 1: Algorithm did not converge in: glm.fit(x = X, y = Y, weights =
> weights, start = start, etastart = etastart,  
> 2: fitted probabilities numerically 0 or 1 occurred in: glm.fit(x = X, y
> = Y, weights = weights, start = start, etastart = etastart,  

.^2 means all the 2-order and 1-order terms,so .+.^2 is meaningless.

> How can I do this?
>  
> logistic.model = glm(similarity ~ . + . ^ 2 + poly(.,2),
> family=binomial, data = cData[3001:3800,])


>  
> Thanks
>  
> Stephen
>  
>  
>  
> 
> --
> Internal Virus Database is out-of-date.
> Checked by AVG Anti-Virus.
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


-- 
Department of Sociology
Fudan University,Shanghai
Blog:http://sociology.yculblog.com




More information about the R-help mailing list