# PROC MIXED RANDOM equivalence in R nlme

7 messages
Open this post in threaded view
|
Report Content as Inappropriate

## PROC MIXED RANDOM equivalence in R nlme

 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! ______________________________________________ [hidden email] mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: PROC MIXED RANDOM equivalence in R nlme

Open this post in threaded view
|
Report Content as Inappropriate

## Re: PROC MIXED RANDOM equivalence in R nlme

 In reply to this post by Dennis F. Kahlbaum On 8/10/2017 8:34 AM, Dennis F. Kahlbaum wrote: > -- snip -- I don't have real help, but I'll remind you that R is case sensitive, and it looks like that will be at least one problem in the solution your are working on below: lme not LME data not DATA random = RANDOM > ------------------------------------------------------------------ > > 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 Are the items in your random formula columns in a dataframe named emiss?  Do they have data types?  Even if the data are proprietary some fake data can make the problem more concrete. You are saying "gets caught in a processing loop that produces no errors or warnings"??? > and never produces a result. Therefore, what is the equivalent code > for the SAS RANDOM? > > Thanks! > > ______________________________________________ > [hidden email] 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/posting-guide.html> and provide commented, minimal, self-contained, reproducible code. -- -- Robert W. Baer, Ph.D. Professor of Physiology Kirksville College of Osteopathic Medicine A T Still University of Health Sciences 800 W. Jefferson St Kirksville, MO 63501 660-626-2321 Department 660-626-2965 FAX ______________________________________________ [hidden email] mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: PROC MIXED RANDOM equivalence in R nlme

Open this post in threaded view
|
Report Content as Inappropriate

## Re: PROC MIXED RANDOM equivalence in R nlme

Open this post in threaded view
|
Report Content as Inappropriate