R programming language resources › Forums › Data manipulation › Rstudio ordered logit model
Tagged: ordered logit model
- This topic has 0 replies, 1 voice, and was last updated 12 years ago by
Marie.
- AuthorPosts
- April 18, 2013 at 2:15 am #907
Marie
MemberHi,
I am working on R studio and want to apply an ordered logit/probit model.
My commands are
install.packages(“rms”)
library(rms)
G1.1<- read.csv(“C:/Users/XXX.csv”)
attach(G1.1)
Define variables
Y <- cbind(Y)
X <- cbind(X1, X2, …XXX)
Xvar <- c(“X1”, “X2”, … “XXX”)
Descriptive statistics
summary(Y)
summary(X)
table(Y)
table(Y)/sum(table(Y))
Ordered logit model coefficients
ddist<- datadist(Xvar)
options(datadist=’ddist’)ologit<- lrm(Y ~ X, data=G1.1)
print(ologit)It is working up to the last 2 commands (ologit<- lrm(Y ~ X, data=G1.1)
print(ologit)) , for which I always obtain as the output :ologit<- lrm(Y ~ X, data=G1.1) singular information matrix in lrm.fit (rank= 25 ). Offending variable(s):
X6 X8 Error in lrm(Y ~ X, data = G1.1) : Unable to fit model using “lrm.fit”
print(ologit) Error in print(ologit) : object ‘ologit’ not foundI dont understand why.
I will be very glad to get your help about this. Thank you in advance.Marie
- AuthorPosts
- You must be logged in to reply to this topic.