[R] PROC MIXED RANDOM equivalence in R nlme

Thierry Onkelinx thierry.onkelinx at inbo.be
Fri Aug 11 14:25:12 CEST 2017


Dear Dennis,

Your question assumes that people know both SAS PROC MIXED and R nlme. Only
a limited number of people do. Add the mathematical formulation of the
model. That will increase the number of people that can help you. Adding
the number of levels in each categorical variable and the number of
observation per group is useful too.

Best regards,

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

2017-08-10 15:34 GMT+02:00 Dennis F. Kahlbaum <kbomb op umich.edu>:

> I am trying to reproduce some old SAS PROC MIXED code using R and nlme.
> The data consists of emission readings from vehicles and fuel properties.
> All variables are real numbers except "study" and "vehicle", which are
> character. Unfortunately, since the data are confidential, I'm unable to
> provide an example.
>
> The original SAS v6.12 code is provided below:
>
> ------------------------------------------------------------------
> /* READ DATA */
> DATA emiss;
>    INFILE 'data.tab' LRECL=8000 FIRSTOBS=2 DLM='09'X MISSOVER DSD;
>    INPUT study $ vehicle $ thc rv t5 t9 ar ol ox su bz;
>
> /* CREATE NEW VARIABLES */
> ln_thc = log (thc);
> new    = study||vehicle;
>
> /* PERFORM ANALYSIS */
> PROC MIXED DATA=emiss MAXITER=1000 CONVH=1E-8 METHOD=REML NOCLPRINT
> NOITPRINT;
> CLASS new;
>
> MODEL ln_thc = rv t5 t9 ar ol ox su bz
>                 /S DDFM=RES;
>
> RANDOM         int rv t5 t9 ar ol ox su bz
>                /SUB=new;
> RUN;
> ------------------------------------------------------------------
>
> The R code I've devised for the PROC MIXED statement is shown below:
>
> ------------------------------------------------------------------
> FitTHC <- LME(ln_thc ~ rv + t5 + t9 + ar + ol + ox + su + bz,
>           DATA = emiss,
>           RANDOM = ??????? )
> ------------------------------------------------------------------
>
> As indicated, the problem I'm having is in constructing the equivalent
> code for the RANDOM and any remaining settings. I've tried
>
> RANDOM = ~1 + rv + t5 + t9 + ar + ol + ox + su + bz | new)
>
> but R hangs and never produces a result. Therefore, what is the equivalent
> code for the SAS RANDOM?
>
> Thanks!
>
> ______________________________________________
> R-help op r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posti
> ng-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list