[R] How to test significant differences for non-linear relationships for two locations

ctu at bigred.unl.edu ctu at bigred.unl.edu
Tue May 27 11:07:53 CEST 2008


Hi Jenny,

My suggestion is that
1. require(nlme)
2. combine two data sets and create a new variable e.g., location
thus your new data set will look like this as following, such as,

y    x location
10   0   L1
11   1   L1
12   2   L1
10.1 0   L2
11.2 1   L2
12.1 2   L3

3. Group your data set, LAST<-groupedData(y~x|location, data=new)
4. test<-nlme(y~logistic.function, data=LAST, fixed=alpha+tau+psi~location,
               random=pdDiag(alpha+tau+psi~1),
               start=c(alpha.value,0, tau.value,0,psi.valu,0))
5.anova(test) (<-your answer)
You could find this in Pinheiro and Bates books

Chunhao Tu


Quoting Jenny Sun <jenny.sun.sun at gmail.com>:

> Hi List,
>
> I have to compare a relationship between y and x for two locations.   
> I found logistic regression fits both datasets well, but I am not   
> sure  how to test if relationships for both sites are significantly   
> different. I searched the r site, however no answers exactly match   
> the question.
>
> I used Tukey's HSD to compare two means, but the relationship in my   
> study was not simply linear. So I was wondering if there is anyone   
> had experience in making such comparisons. Thanks in advance!
>
> Jenny
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list