[R] Translation of R code required
Sarah White
swhite at sgul.ac.uk
Fri Nov 3 18:48:38 CET 2006
Dear All
I am a complete novice when it comes to R. I have been sent some code
which I need to run on a dataset. I have downloaded and installed R
but I dont seem to be able to get the code to run.
I was hoping someone on the list would be able to give me a
'translation' of what the code is trying to do and if there appears to
be any errors in it.
The code is;
mental <- read.csv("dataextract.csv")
mental$Rx <- factor(mental$Rx, levels=c("VS","IPS"))
library(MASS)
model.effect <- glmmPQL(p~Benefit/Rx, ~1|Centre, data=mental, family=quasi(link="identity", variance="mu(1-mu)"), weight=n)
model.combined <- glmmPQL(p~ Rx, ~1|Centre, data=mental, family=quasi(link="identity", variance="mu(1-mu)"), weight=n)
summary(model.effect)
summary(model.combined)
model.overall <- glmmPQL(p~-1+Benefit, ~1|Centre, data=mental, family=quasi( link="identity",variance="mu(1-mu)"), weight=n)
model.overall.combined <- glmmPQL(p~1, ~1|Centre, data=mental, family=quasi( link="identity",variance="mu(1-mu)"), weight=n)
summary(model.overall)
summary(model.overall.combined)
The dataset being read in has six variables, Centre, p, r, n, Rx and
Benefit.
I would really appreciate help with this. I am an experienced, SAS,
SPSS, Stata user but never tried R before and I dont have the luxury of
lots of time with which to master it currently.
Sarah
--
---------------------------------------------------------------------
Sarah White
Biostatistician
Research Resource Unit
Division of Mental Health
St George's, University of London
Cranmer Terrace
Tooting
LONDON SW17 0RE
Direct Line; 020 8725 3615
Fax; 020 8725 3538
Email; s.white at sgul.ac.uk
--
believed to be clean.
More information about the R-help
mailing list