I use SAS a LOT, probably in a ratio of 100 to 1 over R, for mixed models.  

However, one thing I would never do is use the covtest option in PROC MIXED to see whether a variance component was "significant" or not.  There is a reason that Russ Wolfinger and the other developers pulled it out of the default output, and it is that a Wald test here is, well, the best I can come up with is "a very bad idea".  Estimation of the standard error of a variance component is difficult, and strongly sensitive to assumptions, as well as being non-linear and iterative, so that there is sensitive dependence on initial conditions (SDIC).  So the Hessian inverse may be chaotic.  Thus, any "p value" you get is certainly suspect.

Second, why in the world would you 'test' for significance of a variance component to begin with?  What end can be obtained from it?  Variance components arise out of design considerations, and I can't imagine a null hypothesis relevant in this case.  That may be the fault of my imagination, but isn't the whole point estimation and accommodation of identifiable sources of variation?

Pardon the soapbox...
 
Steve Denham 
Director, Biostatistics 
MPI Research, Inc.


>________________________________
> From: Ben Bolker <bbolker@gmail.com>
>To: Mao Huang <hannahmaohuang@gmail.com> 
>Cc: "r-sig-mixed-models@r-project.org" <r-sig-mixed-models@r-project.org> 
>Sent: Tuesday, July 15, 2014 1:11 PM
>Subject: Re: [R-sig-ME] Very important question regarding the error while	using library(lme4)
> 
>
>[cc'ing to r-sig-mixed-models]
>
>Please ask these kinds of general question on
>r-sig-mixed-models@r-project.org .  And see http://glmm.wikidot.com/faq ,
>?pvalues in the package help, and the lmerTest package ...
>
>
>On Tue, Jul 15, 2014 at 9:51 AM, Mao Huang <hannahmaohuang@gmail.com> wrote:
>
>> Hi Ben,
>>
>> I got a new question for ya:
>>
>> lmer can provide the estimates of variance-covariance for the variables
>> that you put in the model.
>> e.g. Y= X1 + X2
>>
>> But I want to test to see if the effects of X1 or X2  are significant or
>> not, which needs a test for these variables.
>>
>> In SAS proc mixed we could specify "covtest", which then provide the
>> Z-test value and p-value for each of those variables (along with their
>> estimated variances).
>> So based on that, we could see if any of these factors are significant or
>> not.
>> example output would be something like this, here X1 and X2 are not
>> significant:
>>
>> Covariance Parameter Estimates
>> Cov Parm Estimate Standard Error Z Value Pr > Z
>> X1  222.19 182.50    1.22 0.1117
>> X2  2.3316 1.8721    1.25 0.1065
>> Residual 89.0390 2.8537 31.20 <.0001
>>
>>
>>
>> How do you do such similar tests  in lme4() ?
>>
>> Thanks.
>>
>>
>>
>>
>>
>> On Mon, Jul 14, 2014 at 11:08 PM, Ben Bolker <bbolker@gmail.com> wrote:
>>
>>> glad it worked.
>>>
>>>
>>> On Mon, Jul 14, 2014 at 11:01 PM, mao Huang <hannahmaohuang@gmail.com>
>>> wrote:
>>>
>>>> It worked. Thanks so much!
>>>> I hope it was that obvious to me at the beginning too :(
>>>>
>>>> I thought it was the library path problem and so was keeping checking on
>>>> that....:(
>>>>
>>>>
>>>>
>>>> Sent from my iPhone
>>>>
>>>> On Jul 14, 2014, at 9:38 PM, Ben Bolker <bbolker@gmail.com> wrote:
>>>>
>>>>   [cc'ing to r-sig-mixed-models]
>>>>
>>>>   The obvious question would be whether you have tried
>>>>
>>>> install.packages("minqa")
>>>>
>>>> ?
>>>>
>>>>  I would try that, then *re*-install lme4.
>>>>
>>>>  Otherwise: operating system, results of sessionInfo(), results of
>>>>
>>>> installed.packages()[c("lme4","minqa"),]
>>>>
>>>> ?
>>>>
>>>>
>>>> On Mon, Jul 14, 2014 at 3:54 PM, Huang, Mao <
>>>> huang.823@buckeyemail.osu.edu> wrote:
>>>>
>>>>>  Hi Ben,
>>>>>
>>>>> Thank you for your work in creating lme4()
>>>>>
>>>>>  I need to analyze my data very urgently using lmer in lme4 library.
>>>>>
>>>>>  I tried different ways to download the package, it can be downloaded
>>>>> and installed properly.
>>>>> But once I call the library, it gives error and I can't use it:
>>>>>
>>>>>  utils:::menuInstallLocal()
>>>>> package ‘lme4’ successfully unpacked and MD5 sums checked
>>>>>
>>>>>  > library(lme4)
>>>>> Error in library.dynam(lib, package, package.lib) :
>>>>>   DLL ‘minqa’ not found: maybe not installed for this architecture?
>>>>> Error: package or namespace load failed for ‘lme4’
>>>>>
>>>>>
>>>>>  I tried to look for answers online but nothing useful found yet.
>>>>>
>>>>>  Do you have any idea what's going on there?
>>>>>
>>>>>  Please reply at your earliest convenience.
>>>>>
>>>>>  Thanks so much!
>>>>>
>>>>>  Mao
>>>>>
>>>>> ​
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
>    [[alternative HTML version deleted]]
>
>_______________________________________________
>R-sig-mixed-models@r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>
>
	[[alternative HTML version deleted]]

