Hello, I'm planning to start using R. Before getting into it, I'd like to ask a couple of questions. Does R carry out loglinear model analysis? That is, will it provide the chi-squared goodness of fit test statistic for a given hierarchical loglinear model? Maybe even do a model selection procedure (like Brown's two-step procedure, or forward/backward selection)? Thanks for your help. ---Harry Khamis -- Harry Khamis Statistical Consulting Center Wright State University Dayton, OH 45435 USA Phone: (937) 775-2433 Fax: (937) 775-2081 Homepage: www.math.wright.edu/People/Harry_Khamis/index.html
Dear Harry, There are two ways to fit loglinear models of which I'm aware and probably more that I don't know: The loglin() function fits loglinear models by IPF; there's a convenient front end, loglm(), in the MASS package (one of the recommended packages). As well, you can fit loglinear models as Poisson generalised linear models using the glm() function. At least in the latter case, you can do model selection via step(). I hope that this helps, John At 08:58 AM 1/29/2004 -0500, Harry Khamis wrote:>Hello, > > I'm planning to start using R. Before getting into it, I'd like to > ask a couple of questions. Does R carry out loglinear model analysis? > That is, will it provide the chi-squared goodness of fit test statistic > for a given hierarchical loglinear model? Maybe even do a model > selection procedure (like Brown's two-step procedure, or forward/backward > selection)? Thanks for your help. >---Harry Khamis > >------------------------------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: jfox at mcmaster.ca phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox
On Thu, 29 Jan 2004, Harry Khamis wrote:> I'm planning to start using R. Before getting into it, I'd like to > ask a couple of questions. Does R carry out loglinear model analysis?Yes. (It has several functions to do so, including glm, loglin, loglm and multinom). Putting `loglinear' into the help search found all of those.> That is, will it provide the chi-squared goodness of fit test statistic > for a given hierarchical loglinear model?Yes (although there are two, sometimes known as G^2 and X^2, so you will need to be careful).> Maybe even do a model selection procedure (like Brown's two-step > procedure, or forward/backward selection)?Yes. R is currently been used here on a course on log-linear models for social scientists, at their suggestion. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595