[R] ordglm -- simple question

From: Anders Schwartz Corr <corr_at_fas.harvard.edu>
Date: Tue 07 Jun 2005 - 23:48:13 EST

My attempt to test a model using ordglm code is running into problems, and I thought if you have a moment you might illucidate the situation.

Here is the data:

http://www.people.fas.harvard.edu/~corr/6.4.05.RData

Here is the code:

# I coerce tcn8 matrix data to a vector, because ordglm will not accept matrix data.
y<-as.vector(tcn8[,62])
x<-as.vector(tcn8[,60])
wt<-as.vector(tcn8[,61])
cbind(y,x,wt)->tc
colnames(tc) <- c("y","x","wt")
ordglm(y ~ x, weights=wt, data=tc, link = "logit")

Here is the output:

> y<-as.vector(tcn8[,62])
> x<-as.vector(tcn8[,60])
> wt<-as.vector(tcn8[,61])
> cbind(y,x,wt)->tc
> colnames(tc) <- c("y","x","wt")
> ordglm(y ~ x, weights=wt, data=tc, link = "logit")

Error in model.frame.default(mt, data, na.action = na.fail) :

        `data' must be a data.frame, not a matrix or array
>

Perhaps it is a problem of having NAs and NaNs in my data? I appreciate any pointers. Do I need to set model.frame first?

Thanks,

Anders Corr



R-help@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 Received on Wed Jun 08 00:21:00 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:26 EST