Displaying 6 results from an estimated 6 matches for "upperci".
2009 Jan 15
1
Confidence Intervals for Poisson
...3
library(MASS)
set.seed(125)
x <- rpois(100,12.73)
lambda_hat<-fitdistr(x, dpois, list(lambda=12))$estimate
#Confidence Intervals - Normal Approx.
alpha<-c(.05,.025,.01)
for(n in 1:length(alpha)) {
LowerCI<-mean(x)-(qnorm(1-alpha[n]/2, mean = 0, sd =
1)*sqrt(var(x)/length(x)))
UpperCI<-mean(x)+(qnorm(1-alpha[n]/2, mean = 0, sd =
1)*sqrt(var(x)/length(x)))
cat("For
Alpha=",alpha[n],"LowerCI=",LowerCI,"<","Lambda=",mean(x),"<","UpperCI=",UpperCI,"\n")
}
When I do something like:
qpois(.975, 12.7...
2010 Jan 03
3
R2HTML Report number format, or Better Way?
...ce a report and here's where I get stuck:
How do I get R2HTML to produce the same number format?
Particularly remove the decimal places for Par and Sal.
Are there better methods to produce this type of report?
Thanks,
L.A.
R version 2.10.0 XP
srtype<-cbind(Par,Sal,Median,COD,PRD,LowerCI,UpperCI)
srtype
Par Sal Median COD PRD LowerCI UpperCI
RES I 9683 578 0.9533 29.69 1.191 0.9382 0.9582
RES V 4003 155 0.9763 16.51 1.091 0.9499 0.9943
OTHER 1542 10 0.8367 82.35 1.253 0.4759 2.2293
COM I 1711...
2000 Jul 05
2
couldn't find function "..."
...ht write more complicated functions in the future.
First I created my function named "CIfunc" and saved into the current
directory using the "save" command.
function(Mean, SD, N, Sig) {
if (N > 30) { Zscore <- pnorm(Sig)} else {Zscore <- pt(Sig,N-1)}
Zscore
UpperCI <- Mean + Zscore * SD / sqrt(N)
UpperCI
LowerCI <- Mean - Zscore * SD / sqrt(N)
LowerCI
}
...with no error.
Next I write the function call "testcall":
testcall <- call('CIfunc', prescan10$F532Mean, prescan10$F532SD,
prescan10$FPixels, 0.95)
...with no error...
2000 Jul 06
0
Fwd: Re: couldn't find function ...
...named "CIfunc" and saved into the current
> > directory using the "save" command.
> >
> > function(Mean, SD, N, Sig) {
> >
> > if (N > 30) { Zscore <- pnorm(Sig)} else {Zscore <- pt(Sig,N-1)}
> > Zscore
> >
> > UpperCI <- Mean + Zscore * SD / sqrt(N)
> > UpperCI
> >
> > LowerCI <- Mean - Zscore * SD / sqrt(N)
> > LowerCI
> >
> > }
> >
> > ...with no error.
> >
> > Next I write the function call "testcall":
> >
> >...
2009 Jul 16
0
how to get means and confidence limits after glmmPQL or lmer
...9;m not
sure if the first line below is actually the right variance to use in
estimating the CIs.
variance<-mm$sigma #IS THIS THE RIGHT VARIANCE?
speciessize<- tapply(species, burnagecat1 ,length)
speciesmeans<- (tapply(predict(mm, type="response"), burnagecat1 ,mean))
upperci<- exp(log(speciesmeans) +
qt(0.95,residdf)*sqrt(variance/speciessize))
lowerci<- exp(log(speciesmeans)- qt(0.95,residdf)*sqrt(variance/speciessize))
result<-cbind(lowerci, speciesmeans, upperci)
result
I also explored lmer, but haven't found a way to extract means and
CIs on the o...
2002 Apr 22
2
lattice x(y)lab and expression
...a way to use plotmath in the labels and strips?
E.g.
xyplot(y~x|group,data=test.df,
panel=function(x,y,subscripts,df) {
llines(x,y,col="black",lwd=2)
llines(x,df[subscripts,"lowerCI"],lty=2,col="#aaaaaa")
llines(x,df[subscripts,"upperCI"],lty=2,col="#aaaaaa")
},
strip=function(...) {
# not sure what to put here
# but I would like something like
# substitute(gamma[r]==2*pi*r,list(r=group))
strip.default(strip.names=c(F,F),...)
},
par.strip.text=list(col=...