Why does nlme::getVarCov not Work for nlme Models?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Why does nlme::getVarCov not Work for nlme Models?

Bill Denney
Hi,

 

I was just trying to summarize an nlme model using `broom.mixed::tidy()`,
and it doesn't give random effects or residual variability for nlme models.
As I looked deeper, this appears to be related to the fact that
`nlme::getVarCorr()` doesn't support nlme models for no reason that I can
discern [1].  I do see that it simply has a `stop()` call if the model is
nlme, but I don't know or see a commented reason why this would be.

 

I can imagine that in a nonlinear model the interpretation of variance is
different than in a linear model (namely that it is more likely to be
asymmetric and this result is asymptotic), but that doesn't seem like a
reason to prevent the use of the tool.  When I pretended that my model was
an lme model (set the class temporarily to "lme"), it gave the expected
result.

 

My questions are:

 

1. Why does nlme::getVarCorr() not support nlme models?
2. If there is not a known reason, does someone in R-core think that a
patch removing the stop below [1] would be accepted?

 

[1] https://svn.r-project.org/R-packages/trunk/nlme/R/VarCov.R the lines
are:

    if(any("nlme" == class(obj)))

        stop("not implemented for \"nlme\" objects")

 

Thanks,

 

Bill


        [[alternative HTML version deleted]]

______________________________________________
[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.
Reply | Threaded
Open this post in threaded view
|

Re: Why does nlme::getVarCov not Work for nlme Models?

Bert Gunter-2
1. The Help page for getVarCov says that it supports lme and gls models
only. So not nonlinear models. As to why it does not, that is off topic
here, as that is a statistical question.

2. As this is longstanding, it almost certainly has good reason for being
there, so I would seriously doubt it. But of course I don't speak for R
Core.

Cheers,
Bert

On Mon, Nov 18, 2019 at 9:43 PM <[hidden email]> wrote:

> Hi,
>
>
>
> I was just trying to summarize an nlme model using `broom.mixed::tidy()`,
> and it doesn't give random effects or residual variability for nlme models.
> As I looked deeper, this appears to be related to the fact that
> `nlme::getVarCorr()` doesn't support nlme models for no reason that I can
> discern [1].  I do see that it simply has a `stop()` call if the model is
> nlme, but I don't know or see a commented reason why this would be.
>
>
>
> I can imagine that in a nonlinear model the interpretation of variance is
> different than in a linear model (namely that it is more likely to be
> asymmetric and this result is asymptotic), but that doesn't seem like a
> reason to prevent the use of the tool.  When I pretended that my model was
> an lme model (set the class temporarily to "lme"), it gave the expected
> result.
>
>
>
> My questions are:
>
>
>
> 1.      Why does nlme::getVarCorr() not support nlme models?
> 2.      If there is not a known reason, does someone in R-core think that a
> patch removing the stop below [1] would be accepted?
>
>
>
> [1] https://svn.r-project.org/R-packages/trunk/nlme/R/VarCov.R the lines
> are:
>
>     if(any("nlme" == class(obj)))
>
>         stop("not implemented for \"nlme\" objects")
>
>
>
> Thanks,
>
>
>
> Bill
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [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.
>

        [[alternative HTML version deleted]]

______________________________________________
[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.
Reply | Threaded
Open this post in threaded view
|

Re: Why does nlme::getVarCov not Work for nlme Models?

Bill Denney
Hi Bert,

 

If the statistical reason is off topic here, do you have a suggestion of a better forum?

 

Thanks,

 

Bill

 

From: Bert Gunter <[hidden email]>
Sent: Tuesday, November 19, 2019 11:52 AM
To: [hidden email]
Cc: R-help <[hidden email]>
Subject: Re: [R] Why does nlme::getVarCov not Work for nlme Models?

 

1. The Help page for getVarCov says that it supports lme and gls models only. So not nonlinear models. As to why it does not, that is off topic here, as that is a statistical question.

 

2. As this is longstanding, it almost certainly has good reason for being there, so I would seriously doubt it. But of course I don't speak for R Core.

 

Cheers,

Bert

 

On Mon, Nov 18, 2019 at 9:43 PM <[hidden email] <mailto:[hidden email]> > wrote:

Hi,



I was just trying to summarize an nlme model using `broom.mixed::tidy()`,
and it doesn't give random effects or residual variability for nlme models.
As I looked deeper, this appears to be related to the fact that
`nlme::getVarCorr()` doesn't support nlme models for no reason that I can
discern [1].  I do see that it simply has a `stop()` call if the model is
nlme, but I don't know or see a commented reason why this would be.



I can imagine that in a nonlinear model the interpretation of variance is
different than in a linear model (namely that it is more likely to be
asymmetric and this result is asymptotic), but that doesn't seem like a
reason to prevent the use of the tool.  When I pretended that my model was
an lme model (set the class temporarily to "lme"), it gave the expected
result.



My questions are:



1.      Why does nlme::getVarCorr() not support nlme models?
2.      If there is not a known reason, does someone in R-core think that a
patch removing the stop below [1] would be accepted?



[1] https://svn.r-project.org/R-packages/trunk/nlme/R/VarCov.R the lines
are:

    if(any("nlme" == class(obj)))

        stop("not implemented for \"nlme\" objects")



Thanks,



Bill


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] <mailto:[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.


        [[alternative HTML version deleted]]

______________________________________________
[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.
Reply | Threaded
Open this post in threaded view
|

Re: Why does nlme::getVarCov not Work for nlme Models?

David Winsemius

On 11/19/19 8:59 AM, [hidden email] wrote:
> Hi Bert,
>
>  
>
> If the statistical reason is off topic here, do you have a suggestion of a better forum?

There are two forums of the top of my head. The first should have been
obvious if you had reviewed the mailing lists under the r-project.org
domain, i.e. the mixed effects SIG list. The other would be
CrossValidated.com


--

David.

>
>  
>
> Thanks,
>
>  
>
> Bill
>
>  
>
> From: Bert Gunter <[hidden email]>
> Sent: Tuesday, November 19, 2019 11:52 AM
> To: [hidden email]
> Cc: R-help <[hidden email]>
> Subject: Re: [R] Why does nlme::getVarCov not Work for nlme Models?
>
>  
>
> 1. The Help page for getVarCov says that it supports lme and gls models only. So not nonlinear models. As to why it does not, that is off topic here, as that is a statistical question.
>
>  
>
> 2. As this is longstanding, it almost certainly has good reason for being there, so I would seriously doubt it. But of course I don't speak for R Core.
>
>  
>
> Cheers,
>
> Bert
>
>  
>
> On Mon, Nov 18, 2019 at 9:43 PM <[hidden email] <mailto:[hidden email]> > wrote:
>
> Hi,
>
>
>
> I was just trying to summarize an nlme model using `broom.mixed::tidy()`,
> and it doesn't give random effects or residual variability for nlme models.
> As I looked deeper, this appears to be related to the fact that
> `nlme::getVarCorr()` doesn't support nlme models for no reason that I can
> discern [1].  I do see that it simply has a `stop()` call if the model is
> nlme, but I don't know or see a commented reason why this would be.
>
>
>
> I can imagine that in a nonlinear model the interpretation of variance is
> different than in a linear model (namely that it is more likely to be
> asymmetric and this result is asymptotic), but that doesn't seem like a
> reason to prevent the use of the tool.  When I pretended that my model was
> an lme model (set the class temporarily to "lme"), it gave the expected
> result.
>
>
>
> My questions are:
>
>
>
> 1.      Why does nlme::getVarCorr() not support nlme models?
> 2.      If there is not a known reason, does someone in R-core think that a
> patch removing the stop below [1] would be accepted?
>
>
>
> [1] https://svn.r-project.org/R-packages/trunk/nlme/R/VarCov.R the lines
> are:
>
>      if(any("nlme" == class(obj)))
>
>          stop("not implemented for \"nlme\" objects")
>
>
>
> Thanks,
>
>
>
> Bill
>
>
>          [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] <mailto:[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.
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [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.

______________________________________________
[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.