Hello,
I'm trying to create birth centile charts from about 90000 birth weights
using the package lmsqreg. As this is not a CRAN package I have problems finding
any examples, which explain how to estimate the LMS parameters needed for the
equivalent degrees of freedom. (I only have some basic understanding of
statistics, I roughly understand the formulas, but then I don't know how to
recreate them in R.) Does anyone have an example?
So far I have done this:
library(lmsqreg)
centiles <- c(0.004,0.02,0.09,0.25,0.5,0.75,0.91,0.98,0.996)
lms.fit <-
lmsqreg.fit(boys.o$BIRTH_WEIGHT,boys.0$GEST_AGE,edf=c(3,5,3),pvec=centiles)
plot(lms.fit)
points(boys.0$GEST_AGE,boys.0$BIRTH_WEIGHT)
I also plotted the median and the coefficient of variation by gestation age, but
then I'm struggling to find the correct command to plot the Box-Cox power by
gestation age. (Does it makes sense to compute all centiles in one go?)
Thanks Joanne
P.S.: I found a couple of recent articles that refer to the GAMLSS package, but
that looks even more complicated to me.
###################
Running R on Windows XP
> sessionInfo()
R version 2.10.1 (2009-12-14)
i386-pc-mingw32
locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats4 splines stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] VGAM_0.7-10 lmsqreg_0.0-6 MASS_7.3-5 quantreg_4.44 SparseM_0.83
loaded via a namespace (and not attached):
[1] tools_2.10.1
> Sys.getlocale()
[1] "LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United
Kingdom.1252;LC_MONETARY=English_United
Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United
Kingdom.1252">
[[alternative HTML version deleted]]