Quantcast

Test for multiple comparisons: Nonlinear model, autocorrelation?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Test for multiple comparisons: Nonlinear model, autocorrelation?

J S-19

Dear R community,
 
I have a nonlinear model describing average daily soil temperature. What test should I use to compare differences in soil temperature of the two studied vegetation types depending upon month?
 
Building linear contrasts for the developed nonlinear model does not help since this model does not include variable “Months” (only “Days”).
 
1) Just a Student’s test is not probably an option because I would violate an assumption of independency, since the daily soil temperature observations have high autocorrelation. Or maybe I could average the observations for each month and then use this test since I have observations for a few years, and it might overcome the problem of independency?
 
2) Should I develop a second nonlinear model with months instead of days, but it would considerably increase a number of parameters in the model...
 
Or:
3) ?
 
Thanks for your help,
Julia
_________________________________________________________________
It’s a talkathon – but it’s not just talk.

        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Test for multiple comparisons: Nonlinear model, autocorrelation?

Spencer Graves
  The question seems too general for me to offer specific suggestions.

What problem are you trying to solve that you think 'multiple
comparisons' will answer?

Can you produce a similar problem that is completely self-contained
example that eliminates complexity that may not be needed to understand
your question (similar to the 'Auxiliary Problem' technique in "How to
Solve It", http://en.wikipedia.org/wiki/How_to_Solve_It)? If you can, it
may lead you to a solution. If you get such an example but still can't
see a solution, send that example to this list (following the advice in
the posting guide http://www.R-project.org/posting-guide.html). The
simpler the example, the more likely someone on this list will reply
quickly with a useful suggestion.

I know this doesn't solve your problem, but I hope it helps.
Spencer

J S wrote:

> Dear R community,
>  
> I have a nonlinear model describing average daily soil temperature. What test should I use to compare differences in soil temperature of the two studied vegetation types depending upon month?
>  
> Building linear contrasts for the developed nonlinear model does not help since this model does not include variable “Months” (only “Days”).
>  
> 1) Just a Student’s test is not probably an option because I would violate an assumption of independency, since the daily soil temperature observations have high autocorrelation. Or maybe I could average the observations for each month and then use this test since I have observations for a few years, and it might overcome the problem of independency?
>  
> 2) Should I develop a second nonlinear model with months instead of days, but it would considerably increase a number of parameters in the model...
>  
> Or:
> 3) ?
>  
> Thanks for your help,
> Julia
> _________________________________________________________________
> It’s a talkathon – but it’s not just talk.
>
> [[alternative HTML version deleted]]
>
>  
> ------------------------------------------------------------------------
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Test for multiple comparisons: Nonlinear model, autocorrelation?

J S-19

Thanks. Here is a similar example from a book by Pinheiro and Bates (2000, chapter 6):
 
library(nlme) data(Soybean)
fm1Soy.lis <- nlsList( weight ~ SSlogis(Time, Asym, xmid, scal),    data = Soybean ) fm1Soy.nlme <- nlme( fm1Soy.lis )
 
If we would like to make comparisons among the years we could just simply involve years as a covariate, and later we could use L argument to ANOVA to could compute contrasts.
 
soyFix <- fixef( fm1Soy.nlme )  fm2Soy.nlme <- update( fm1Soy.nlme,    fixed = Asym + xmid + scal ~ Year,    start = c(soyFix[1], 0, 0, soyFix[2], 0, 0, soyFix[3], 0, 0) )
 
My question is: How can I compare variety of soybeans in a separate month, i.e. if there was a difference in weight of soybeans F and P in first month, …in twelve month?
 
The dataset “Soybean”:
      Plot Variety Year Time    weight
1   1988F1       F 1988   14  0.106000
2   1988F1       F 1988   21  0.261000
3   1988F1       F 1988   28  0.666000
4   1988F1       F 1988   35  2.110000
5   1988F1       F 1988   42  3.560000
….
407 1990P8       P 1990   30  1.478330
408 1990P8       P 1990   37  2.601667
409 1990P8       P 1990   43  6.343330
410 1990P8       P 1990   51  6.131670
411 1990P8       P 1990   64 16.411700
412 1990P8       P 1990   79 16.946700
 
1)      Involving months and variety as a covariates will probably create too many parameters for the model?
2)      Is it possible to use some test for comparisons, let’s say t test? Perhaps not in case the data are dependent (i.e. previous measurement is dependent on the next measurement, i.e. there is temporal correlation (as in my study of Soil temperature)? What is an alternative suggestion?
 
Thanks,
Julia> Date: Fri, 4 Jul 2008 17:36:29 -0700> From: [hidden email]> To: [hidden email]> CC: [hidden email]> Subject: Re: [R] Test for multiple comparisons: Nonlinear model, autocorrelation?> > The question seems too general for me to offer specific suggestions.> > What problem are you trying to solve that you think 'multiple > comparisons' will answer?> > Can you produce a similar problem that is completely self-contained > example that eliminates complexity that may not be needed to understand > your question (similar to the 'Auxiliary Problem' technique in "How to > Solve It", http://en.wikipedia.org/wiki/How_to_Solve_It)? If you can, it > may lead you to a solution. If you get such an example but still can't > see a solution, send that example to this list (following the advice in > the posting guide http://www.R-project.org/posting-guide.html). The > simpler the example, the more likely someone on this list will reply > quickly with a useful suggestion.> > I know this doesn't solve your problem, but I hope it helps.> Spencer> > J S wrote:> > Dear R community, > > > > I have a nonlinear model describing average daily soil temperature. What test should I use to compare differences in soil temperature of the two studied vegetation types depending upon month?> > > > Building linear contrasts for the developed nonlinear model does not help since this model does not include variable “Months” (only “Days”). > > > > 1) Just a Student’s test is not probably an option because I would violate an assumption of independency, since the daily soil temperature observations have high autocorrelation. Or maybe I could average the observations for each month and then use this test since I have observations for a few years, and it might overcome the problem of independency?> > > > 2) Should I develop a second nonlinear model with months instead of days, but it would considerably increase a number of parameters in the model...> > > > Or:> > 3) ?> > > > Thanks for your help,> > Julia> > _________________________________________________________________> > It’s a talkathon – but it’s not just talk.> >> > [[alternative HTML version deleted]]> >> > > > ------------------------------------------------------------------------> >> > ______________________________________________> > [hidden email] 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.> >
_________________________________________________________________
The i’m Talkaton. Can 30-days of conversation change the world?

        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Test for multiple comparisons: Nonlinear model, autocorrelation?

Spencer Graves
      If I had only a very limited time to do this, I might include
'month' as another effect, probably coded as 'sin' and 'cos' on an
annual cycle rather than as 12 individual Indicators.  This would allow
you to explore not only main effects but interactions with plots.

      Before I did that, however, I'd want to generate more plots of
data, residuals, and coefficients.  For example,
qqnorm(resid(fm1Soy.nlme), datax=TRUE) displayed an S shape that
indicated inhomogeniety of variance.  This suggests that there is
something else to be modeled in these data.  I would next try plotting
residuals by 'month'.  I'd also plot the averages and standard
deviations by 'month'.  This might tell me if I only need to add a fixed
annual cycle, and how much of a Fourier series approximation to add.  If
the standard deviations show a pattern, it suggests I need to model
heteroscedasticity.  For that see '?varClasses' and the corresponding
information in a book by Pinheiro and Bates (2000), mentioned on that
help page.  You can do 'anova' for any of these effects.  [To test
changes in fixed effects, you will need to use method='ML', as discussed
in a book by Pinheiro and Bates (2000).]

      Hope this helps.
      Spencer

J S wrote:

>
> Thanks. Here is a similar example from a book by Pinheiro and Bates
> (2000, chapter 6):
>
>  
>
> library(nlme)
> data(Soybean)
>
> fm1Soy.lis <- nlsList( weight ~ SSlogis(Time, Asym, xmid, scal),
>    data = Soybean )
> fm1Soy.nlme <- nlme( fm1Soy.lis )
>
>  
>
> *If we would like to make comparisons among the years we could just
> simply involve years as a covariate, and later we could use L argument
> to ANOVA to could compute contrasts. *
>
>  
>
> soyFix <- fixef( fm1Soy.nlme )
>  fm2Soy.nlme <- update( fm1Soy.nlme,
>    fixed = Asym + xmid + scal ~ Year,
>    start = c(soyFix[1], 0, 0, soyFix[2], 0, 0, soyFix[3], 0, 0) )
>
> * *
>
> *My question is: How can I compare variety of soybeans in a separate
> month, i.e. if there was a difference in weight of soybeans F and P in
> first month, …in twelve month?*
>
>  
>
> The dataset “Soybean”:
>
>       Plot Variety Year Time    weight
>
> 1   1988F1       F 1988   14  0.106000
>
> 2   1988F1       F 1988   21  0.261000
>
> 3   1988F1       F 1988   28  0.666000
>
> 4   1988F1       F 1988   35  2.110000
>
> 5   1988F1       F 1988   42  3.560000
>
> ….
>
> 407 1990P8       P 1990   30  1.478330
>
> 408 1990P8       P 1990   37  2.601667
>
> 409 1990P8       P 1990   43  6.343330
>
> 410 1990P8       P 1990   51  6.131670
>
> 411 1990P8       P 1990   64 16.411700
>
> 412 1990P8       P 1990   79 16.946700
>
>  
>
> 1)      Involving months and variety as a covariates will probably
> create too many parameters for the model?
>
> 2)      Is it possible to use some test for comparisons, let’s say t
> test? Perhaps not in case the data are dependent (i.e. previous
> measurement is dependent on the next measurement, i.e. there is
> temporal correlation (as in my study of Soil temperature)? What is an
> alternative suggestion?
>
>  
>
> Thanks,
>
> Julia
>
>
>
> > Date: Fri, 4 Jul 2008 17:36:29 -0700
> > From: [hidden email]
> > To: [hidden email]
> > CC: [hidden email]
> > Subject: Re: [R] Test for multiple comparisons: Nonlinear model,
> autocorrelation?
> >
> > The question seems too general for me to offer specific suggestions.
> >
> > What problem are you trying to solve that you think 'multiple
> > comparisons' will answer?
> >
> > Can you produce a similar problem that is completely self-contained
> > example that eliminates complexity that may not be needed to understand
> > your question (similar to the 'Auxiliary Problem' technique in "How to
> > Solve It", http://en.wikipedia.org/wiki/How_to_Solve_It)? If you
> can, it
> > may lead you to a solution. If you get such an example but still can't
> > see a solution, send that example to this list (following the advice in
> > the posting guide http://www.R-project.org/posting-guide.html). The
> > simpler the example, the more likely someone on this list will reply
> > quickly with a useful suggestion.
> >
> > I know this doesn't solve your problem, but I hope it helps.
> > Spencer
> >
> > J S wrote:
> > > Dear R community,
> > >
> > > I have a nonlinear model describing average daily soil
> temperature. What test should I use to compare differences in soil
> temperature of the two studied vegetation types depending upon month?
> > >
> > > Building linear contrasts for the developed nonlinear model does
> not help since this model does not include variable “Months” (only
> “Days”).
> > >
> > > 1) Just a Student’s test is not probably an option because I would
> violate an assumption of independency, since the daily soil
> temperature observations have high autocorrelation. Or maybe I could
> average the observations for each month and then use this test since I
> have observations for a few years, and it might overcome the problem
> of independency?
> > >
> > > 2) Should I develop a second nonlinear model with months instead
> of days, but it would considerably increase a number of parameters in
> the model...
> > >
> > > Or:
> > > 3) ?
> > >
> > > Thanks for your help,
> > > Julia
> > > _________________________________________________________________
> > > It’s a talkathon – but it’s not just talk.
> > >
> > > [[alternative HTML version deleted]]
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > >
> > > ______________________________________________
> > > [hidden email] 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.
> > >
>
> ------------------------------------------------------------------------
> The i’m Talkaton. Can 30-days of conversation change the world? Find
> out now.
> <http://www.imtalkathon.com/?source=EML_WLH_Talkathon_ChangeWorld>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Test for multiple comparisons: Nonlinear model, autocorrelation?

J S-19

Thanks for your help and suggestions.
 
That’s exactly what I did, i.e. a sin () and cos () code using daily observations of soil temperature, and putting a variable “vegetation types” as a covariate. Therefore, I can build contrasts to compare parameters of the model such as an intercept, amplitude and phase between different vegetation types.
 
If I understand correctly, you mean to do the similar model but using average monthly data of soil temperature instead of daily soil temperature? Still, I think that the model will allow us comparison of the parameters of the model such as an intercept, amplitude and phase between the vegetation types, but not the monthly soil temperature between different vegetation types…
 
Thanks for your help and I am sorry if I did not understand it correctly or did not describe the experiment clearly.
 
Julia> Date: Sun, 6 Jul 2008 08:38:51 -0700> From: [hidden email]> To: [hidden email]> CC: [hidden email]> Subject: Re: [R] Test for multiple comparisons: Nonlinear model, autocorrelation?> > If I had only a very limited time to do this, I might include > 'month' as another effect, probably coded as 'sin' and 'cos' on an > annual cycle rather than as 12 individual Indicators. This would allow > you to explore not only main effects but interactions with plots. > > Before I did that, however, I'd want to generate more plots of > data, residuals, and coefficients. For example, > qqnorm(resid(fm1Soy.nlme), datax=TRUE) displayed an S shape that > indicated inhomogeniety of variance. This suggests that there is > something else to be modeled in these data. I would next try plotting > residuals by 'month'. I'd also plot the averages and standard > deviations by 'month'. This might tell me if I only need to add a fixed > annual cycle, and how much of a Fourier series approximation to add. If > the standard deviations show a pattern, it suggests I need to model > heteroscedasticity. For that see '?varClasses' and the corresponding > information in a book by Pinheiro and Bates (2000), mentioned on that > help page. You can do 'anova' for any of these effects. [To test > changes in fixed effects, you will need to use method='ML', as discussed > in a book by Pinheiro and Bates (2000).]> > Hope this helps. > Spencer> > J S wrote:> >> > Thanks. Here is a similar example from a book by Pinheiro and Bates > > (2000, chapter 6):> >> > > >> > library(nlme)> > data(Soybean)> >> > fm1Soy.lis <- nlsList( weight ~ SSlogis(Time, Asym, xmid, scal),> > data = Soybean )> > fm1Soy.nlme <- nlme( fm1Soy.lis )> >> > > >> > *If we would like to make comparisons among the years we could just > > simply involve years as a covariate, and later we could use L argument > > to ANOVA to could compute contrasts. *> >> > > >> > soyFix <- fixef( fm1Soy.nlme )> > fm2Soy.nlme <- update( fm1Soy.nlme,> > fixed = Asym + xmid + scal ~ Year,> > start = c(soyFix[1], 0, 0, soyFix[2], 0, 0, soyFix[3], 0, 0) )> >> > * *> >> > *My question is: How can I compare variety of soybeans in a separate > > month, i.e. if there was a difference in weight of soybeans F and P in > > first month, …in twelve month?*> >> > > >> > The dataset “Soybean”:> >> > Plot Variety Year Time weight> >> > 1 1988F1 F 1988 14 0.106000> >> > 2 1988F1 F 1988 21 0.261000> >> > 3 1988F1 F 1988 28 0.666000> >> > 4 1988F1 F 1988 35 2.110000> >> > 5 1988F1 F 1988 42 3.560000> >> > ….> >> > 407 1990P8 P 1990 30 1.478330> >> > 408 1990P8 P 1990 37 2.601667> >> > 409 1990P8 P 1990 43 6.343330> >> > 410 1990P8 P 1990 51 6.131670> >> > 411 1990P8 P 1990 64 16.411700> >> > 412 1990P8 P 1990 79 16.946700> >> > > >> > 1) Involving months and variety as a covariates will probably > > create too many parameters for the model?> >> > 2) Is it possible to use some test for comparisons, let’s say t > > test? Perhaps not in case the data are dependent (i.e. previous > > measurement is dependent on the next measurement, i.e. there is > > temporal correlation (as in my study of Soil temperature)? What is an > > alternative suggestion?> >> > > >> > Thanks,> >> > Julia> >> >> >> > > Date: Fri, 4 Jul 2008 17:36:29 -0700> > > From: [hidden email]> > > To: [hidden email]> > > CC: [hidden email]> > > Subject: Re: [R] Test for multiple comparisons: Nonlinear model, > > autocorrelation?> > >> > > The question seems too general for me to offer specific suggestions.> > >> > > What problem are you trying to solve that you think 'multiple> > > comparisons' will answer?> > >> > > Can you produce a similar problem that is completely self-contained> > > example that eliminates complexity that may not be needed to understand> > > your question (similar to the 'Auxiliary Problem' technique in "How to> > > Solve It", http://en.wikipedia.org/wiki/How_to_Solve_It)? If you > > can, it> > > may lead you to a solution. If you get such an example but still can't> > > see a solution, send that example to this list (following the advice in> > > the posting guide http://www.R-project.org/posting-guide.html). The> > > simpler the example, the more likely someone on this list will reply> > > quickly with a useful suggestion.> > >> > > I know this doesn't solve your problem, but I hope it helps.> > > Spencer> > >> > > J S wrote:> > > > Dear R community,> > > >> > > > I have a nonlinear model describing average daily soil > > temperature. What test should I use to compare differences in soil > > temperature of the two studied vegetation types depending upon month?> > > >> > > > Building linear contrasts for the developed nonlinear model does > > not help since this model does not include variable “Months” (only > > “Days”).> > > >> > > > 1) Just a Student’s test is not probably an option because I would > > violate an assumption of independency, since the daily soil > > temperature observations have high autocorrelation. Or maybe I could > > average the observations for each month and then use this test since I > > have observations for a few years, and it might overcome the problem > > of independency?> > > >> > > > 2) Should I develop a second nonlinear model with months instead > > of days, but it would considerably increase a number of parameters in > > the model...> > > >> > > > Or:> > > > 3) ?> > > >> > > > Thanks for your help,> > > > Julia> > > > _________________________________________________________________> > > > It’s a talkathon – but it’s not just talk.> > > >> > > > [[alternative HTML version deleted]]> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > >> > > > ______________________________________________> > > > [hidden email] 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.> > > >> >> > ------------------------------------------------------------------------> > The i’m Talkaton. Can 30-days of conversation change the world? Find > > out now. > > <http://www.imtalkathon.com/?source=EML_WLH_Talkathon_ChangeWorld>
_________________________________________________________________
The i’m Talkaton. Can 30-days of conversation change the world?

        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

curve3d in emdbook package: scaling z axis?

J S-19
In reply to this post by Spencer Graves

 
Dear R community,
 
Is there an option to assign minimum and maximum values for z axis in 3D graph using the function curve3d from the package emdbook? I know there are such options for x and y axes.
 
Thanks.
Julia

 
     
_________________________________________________________________
Hotmail: Free, trusted and rich email service.

        [[alternative HTML version deleted]]

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