[R] Using df and pf

From: Schatzi <adele_thompson_at_cargill.com>
Date: Wed, 27 Apr 2011 13:43:56 -0700 (PDT)


I wanted to use an F-statistic to get p-values for treatment differences. I have parameter estimates and standard errors. I posted about combining the parameters in a previous post, but here I would just like to test the parameter differences by treatments (it is a nonlinear function). I calculated an F-statistic for parameter a and treatments 1 and 2: fstat=(a1-a2)/sqrt(SEa1^2+SEa2^2)

Here I am looking at the different values of fstat using the pf function and the df function:
df1=20
df2=20
dfv<-rep(0,500)
pfv<-rep(0,500)

values<-6*sort(runif(500))-3

for (i in 1:500){
fstat<-values[i]
dfv[i]<-df(fstat,df1,df2)
pfv[i]<-pf(abs(fstat),df1,df2,lower.tail=FALSE) }

Is it correct to use this pf curve? At first I was trying to use the df function, but I did not understand the output so I plotted it to figure it out.

I feel that I am doing something seriously wrong and am not sure what it is.



In theory, practice and theory are the same. In practice, they are not - Albert Einstein
--
View this message in context: http://r.789695.n4.nabble.com/Using-df-and-pf-tp3479417p3479417.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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.
Received on Wed 27 Apr 2011 - 20:46:55 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 27 Apr 2011 - 21:00:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive