Off topic:Question about ifelse in R
0
0
Entering edit mode
6.7 years ago
mms140130 ▴ 60

Hello,

I have a loop code where I find the linear regression of several variables, and I report the F test and the P-value and the code stope when the regression with intercept only

so I wrote in the loop the following

>  mymodel=lm(gene ~ . ,data=mydata)
 mm=(summary(mymodel))
> 
> ifelse(mm$fstatistic==NULL,NA,pvalue)
>  pvalue= pf(mm$fstatistic[1],mm$fstatistic[2],mm$fstatistic[3],lower.tail=FALSE)

but it doesn't work as I get the following error

Error in pf(mm$fstatistic[1], mm$fstatistic[2], mm$fstatistic[3], lower.tail = FALSE) : 
  Non-numeric argument to mathematical function

any help ?

R • 1.5k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 2543 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6