Dear all, can somebody give me some pointer how I can fit a "linear-by-linear association model" (i.e. loglinear model for the ordinal variables) in R? A brief description can be found here 'https://onlinecourses.science.psu.edu/stat504/node/141'. Thanks for your help
On 4/2/2012 3:34 AM, Christofer Bogaso wrote:> Dear all, can somebody give me some pointer how I can fit a > "linear-by-linear association model" (i.e. loglinear model for the > ordinal variables) in R? A brief description can be found here > 'https://onlinecourses.science.psu.edu/stat504/node/141'. > > Thanks for your help >See my short course, http://www.datavis.ca/courses/VCD/ in particular, http://www.datavis.ca/courses/VCD/R/mental-glm.R # fit linear x linear (uniform) association. Use integer scores for rows/cols Cscore <- as.numeric(Mental$ses) Rscore <- as.numeric(Mental$mental) linlin <- glm(Freq ~ mental + ses + Rscore:Cscore, family = poisson, data = Mental) -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. York University Voice: 416 736-5115 x66249 Fax: 416 736-5814 4700 Keele Street Web: http://www.datavis.ca Toronto, ONT M3J 1P3 CANADA
dear Christofer, Try the following d<-expand.grid(a=1:3,b=1:4) d$freq<-rpois(12,5) o<-glm(freq~factor(a)+factor(b)+I(a*b), family=poisson, data=d) vito Il 02/04/2012 9.34, Christofer Bogaso ha scritto:> Dear all, can somebody give me some pointer how I can fit a > "linear-by-linear association model" (i.e. loglinear model for the > ordinal variables) in R? A brief description can be found here > 'https://onlinecourses.science.psu.edu/stat504/node/141'. > > Thanks for your help > > ______________________________________________ > R-help at 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. >-- ===================================Vito M.R. Muggeo Dip.to Sc Statist e Matem `Vianelli' Universit? di Palermo viale delle Scienze, edificio 13 90128 Palermo - ITALY tel: 091 23895240 fax: 091 485726 http://dssm.unipa.it/vmuggeo
Seemingly Similar Threads
- Questing on fitting Baseline category Logit model
- Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)
- Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)
- Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)
- Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)