could someone explain why the name of FPVAL gets " .value" concatenated onto it when the code below is run and temp is returned. I've been trying to figure this out for too long. It doesn't matter when I put the FPVAL in the return statement. It happens regardless of
whether it's first or last.   Thanks.

f.lmmultenhanced <-
function(response, pred1, pred2)

{

        regmod <- lm(response ~ pred1 + pred2)
        lmsum <- summary(regmod)

        imbcoef<-lmsum$coefficients[2,1]
        retcoef<-lmsum$coefficients[3,1]

        imbpval<-lmsum$coefficients[2,4]
        retpval<-lmsum$coefficients[3,4]

        Fstat<-lmsum$fstatistic[1]

fpval<-pf(Fstat,lmsum$fstatistic[2],lmsum$fstatistic[3],lower=FALSE)


return(list(categrsp=response,pred1=pred1,pred2=pred2,regmod=regmod,

rest=c("FPVAL"=fpval,"IMBCOEF"=imbcoef,"RETCOEF"=retcoef,"IMBPVAL"=imbpval,"RETPVAL"=retpval)
                    ))

 }


x <- 10 + 1:100
y <- 5 +  seq(2,200,by=2)
z <- 2*x + 3*y + rnorm(100)

temp <- f.lmmultenhanced(x,y,z)
print(temp)

______________________________________________
R-help@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.

Reply via email to