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!

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 at 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 at 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]]

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 hangsAre 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! > > ______________________________________________ > R-help at 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/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