Based on the following ci function definition, ci
Expert Answer
Ci<-function(s, p) #passing vector s to the function
Don't use plagiarized sources. Get Your Custom Essay on
Question & Answer: Based on the following ci function definition, ci…..
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
{
Upper<-s[2]+qt(1-(1-p)/2,s[1]-1)*s[3]/sqrt(n);#vector can be #accessed using index value s[1] or s[2] or s[3]
Lower<-s[2]-qt(1-(1-p)/2,s[1]-1)*s[3]/sqrt(n);#S[2]=
Ci<-c(lower, upper) #lower and upper values are passed to ci vector
Names(ci) <-c(paste(p*100,”CILower”,sep=””), paste(p*100,”CIUpper”,sep=””)) # row values are labeled here
Ci #print ci result
}
library(UsingR)
apply(c(homedata, 2,ci),0.9) # c will concatenate all the values and pass values as single parameter as a vector