In addition, it seems the lme function in R are very troubled with the dummy variables used at the first (random) level. Harry
On Tue, Aug 4, 2009 at 6:06 PM, Hongwei Dong <pdxd...@gmail.com> wrote: > Thanks, David, you are right. If I use continuous data such as 1, 2, ...6 > to represent those 6 housing types, the model works with the lme function in > R. The problem is, the relationship between the 6 housing types are not > continuous, which we assume when we use 1,2,..6 to represent them. > Harry > > > > On Tue, Aug 4, 2009 at 5:47 PM, David Winsemius <dwinsem...@comcast.net>wrote: > >> >> On Aug 4, 2009, at 7:48 PM, Hongwei Dong wrote: >> >> Yeah, I have a very large sample size, about 60,000 observations. >>> Multicollinearity should not be a problem here. The weird thing is that >>> SPSS >>> can converge very quickly and gives out reasonable results. >>> The only problem I can think of is that, my first level (random) >>> variables >>> are dummy variables: 6 housing types, and I used five dummies in model >>> and >>> one as the reference. I also tried to combine them into two groups and >>> use >>> only dummy at random level, but it does not work either. >>> >>> is there any one here has similar experience with the LME function in R? >>> >> >> I have absolutely no experience with "LME" but I can predict with very >> high probability that you would be getting more sensible result if you >> modeled those housing types with a single factor variable rather than >> creating 6 dummies. ((Would one generally not create a reference dummy?) >> >> ?factor >> >> -- >> David. >> >> >> >>> Thanks. >>> >>> Harry >>> >>> >>> >>> On Tue, Aug 4, 2009 at 1:28 AM, ONKELINX, Thierry >>> <thierry.onkel...@inbo.be>wrote: >>> >>> Dear Harry, >>>> >>>> Your model seems rather complex. Do you have enough data to support it? >>>> Did you check for multicollinearity between the variables? >>>> >>>> HTH, >>>> >>>> Thierry >>>> >>>> >>>> >>>> ------------------------------------------------------------------------ >>>> ---- >>>> ir. Thierry Onkelinx >>>> Instituut voor natuur- en bosonderzoek / Research Institute for Nature >>>> and Forest >>>> Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, >>>> methodology and quality assurance >>>> Gaverstraat 4 >>>> 9500 Geraardsbergen >>>> Belgium >>>> tel. + 32 54/436 185 >>>> thierry.onkel...@inbo.be >>>> www.inbo.be >>>> >>>> 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 >>>> >>>> -----Oorspronkelijk bericht----- >>>> Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >>>> Namens Hongwei Dong >>>> Verzonden: maandag 3 augustus 2009 19:45 >>>> Aan: r-help@r-project.org >>>> Onderwerp: Re: [R] lme funcion in R >>>> >>>> Thanks for the replies above. Here are my script and data structure: >>>> library(nlme) >>>> tlevel<-lme(fixed = LN_unitlandval ~ >>>> MH_D+APT_D+ResOth_D+NonRes_D+Vacant_D+access_emp1+pct_vacant+transit_D+p >>>> ark_dum,data=lusdrdata,random >>>> = ~MH_D+APT_D+ResOth_D+NonRes_D+Vacant_D | TAZ) >>>> >>>> str: >>>> >>>> $ TAZ : int 100 100 100 100 100 100 100 100 100 100 ... >>>> $ MH_D : num 0 0 0 0 0 0 0 0 0 0 ... >>>> $ APT_D : num 0 0 0 0 0 0 0 0 0 0 ... $ ResOth_D : num 0 0 0 0 0 0 0 0 0 >>>> 0 ... $ NonRes_D : num 0 0 0 0 0 0 0 0 0 1 ... >>>> $ Vacant_D : num 1 1 1 0 0 1 1 1 1 0 ... >>>> $ access_emp1 : num 45.8 45.8 45.8 45.8 45.8 ... >>>> $ pct_vacant : num 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 ... $ >>>> transit_D : >>>> num 0 0 0 0 0 0 0 0 0 0 ... $ park_dum : num 0 0 0 0 0 0 0 0 0 0 ... >>>> >>>> >>>> Thanks. >>>> >>>> Harry >>>> >>>> >>>> >>>> On Mon, Aug 3, 2009 at 10:36 AM, Jason Morgan <jwm-r-h...@skepsi.net> >>>> wrote: >>>> >>>> On 2009.08.03 10:15:46, Hongwei Dong wrote: >>>>> >>>>>> Hi, R users, >>>>>> I'm using the "lme" function in R to estimate a 2 level mixed >>>>>> effects model, in which the size of the subject groups are >>>>>> different. It turned >>>>>> >>>>> out >>>>> >>>>>> that It takes forever for R to converge. I also tried the same thing >>>>>> >>>>> >>>> in >>>>>> >>>>> SPSS >>>>> >>>>>> and SPSS can give the results out within 20 minutes. Anyone can give >>>>>> >>>>> >>>> me >>>>>> >>>>> some >>>>> >>>>>> advice on the lme function in R, especially why R does not converge? >>>>>> >>>>> Thanks. >>>>> >>>>>> >>>>>> Harry >>>>>> >>>>> >>>>> Hello Harry, >>>>> >>>>> As Chuck mentions, providing some more information on the model and >>>>> the data you are using would be helpful. Also, be sure to compare the >>>>> optimization methods used in SPSS to that used in R. You can change >>>>> the optimization method in R if the default seems to be causing >>>>> issues. See help(lmeControl) for numerous setting options. >>>>> >>>>> ~Jason >>>>> >>>>> -- >>>>> Jason W. Morgan >>>>> Graduate Student >>>>> Department of Political Science >>>>> *The Ohio State University* >>>>> 154 North Oval Mall >>>>> Columbus, Ohio 43210 >>>>> >>>>> >>>>> >>>> [[alternative HTML version deleted]] >>>> >>>> ______________________________________________ >>>> R-help@r-project.org mailing list >>>> 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. >>>> >>>> Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver >>>> weer >>>> en binden het INBO onder geen enkel beding, zolang dit bericht niet >>>> bevestigd is >>>> door een geldig ondertekend document. The views expressed in this >>>> message >>>> and any annex are purely those of the writer and may not be regarded as >>>> stating >>>> an official position of INBO, as long as the message is not confirmed by >>>> a >>>> duly >>>> signed document. >>>> >>>> >>> [[alternative HTML version deleted]] >>> >>> ______________________________________________ >>> R-help@r-project.org mailing list >>> 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. >>> >> >> David Winsemius, MD >> Heritage Laboratories >> West Hartford, CT >> >> > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list 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.