University of Massachusetts Amherst
ILLUSTRATING THE COMPUTATIONS ON PAGES 31-34 IN NOTES USING KISHI DATA IN R. THE CAT COMMAND LIST THINGS WHICH CAN BE
A MIX OF TEXT AND VARIABLES
HERE IS THE SCRIPT
data cat("confidence interval",yhat,seyhat,l95m,u95m,"\n")
confidence interval 13.56695 0.9762317 11.57033 15.56357
> cat("prediction interval",yhat,sepred,l95i,u95i,"\n")
prediction interval 13.56695 3.46849 6.473092 20.66081
>
> cat(" Simultaneous 95% ci's on beta0 and beta 1","\n")
Simultaneous 95% ci's on beta0 and beta 1
> tval2 = qt(1-(alpha/4),dfe)
> lbeta0s=b0-(tval2*seb0)
> ubeta0s=b0+(tval2*seb0)
> lbeta1s=b1-(tval2*seb1)
> ubeta1s=b1+(tval2*seb1)
> cat(lbeta0s,ubeta0s,lbeta1s,ubeta1s,"\n")
-3.873648 4.705977 0.3457223 0.486606
>
> cat("SIMULTANEOUS CONFIDENCE INTERVALS ON THE MEAN/EXPECTED VALUE
+ FOR BALANCE AT intake = 30,60 and 80","\n")
SIMULTANEOUS CONFIDENCE INTERVALS ON THE MEAN/EXPECTED VALUE
FOR BALANCE AT intake = 30,60 and 80
>
> cat("using Bonferroni","\n")
using Bonferroni
>
> tbon = qt(1-(alpha/2*3),dfe)
> yhat30 = b0 + b1*30
> se30 = sqrt(s2b0 + (30**2)*s2b1 + 2*30*sb0b1)
> l30m = yhat30 - tbon*se30
> u30m = yhat30 + tbon*se30
> yhat60 = b0 + b1*60
> se60 = sqrt(s2b0 + (60**2)*s2b1 + 2*60*sb0b1)
> l60m = yhat60 - tbon*se60
> u60m = yhat60 + tbon*se60
> yhat80 = b0 + b1*80
> se80 = sqrt(s2b0 + (80**2)*s2b1 + 2*80*sb0b1)
> l80m = yhat80 - tbon*se80
> u80m = yhat80 + tbon*se80
> cat(l30m, u30m, l60m, u60m, l80m, u80m,"\n")
11.40117 14.40101 24.49524 26.27679 32.38102 35.03758
>
> cat("USING SCHEFFE","\n")
USING SCHEFFE
>
> f= qf(1-alpha,2,dfe)
> mult = sqrt(2*f)
> l30ms = yhat30 - mult*se30
> u30ms = yhat30 + mult*se30
> l60ms = yhat60 - mult*se60
> u60ms = yhat60 + mult*se60
> l80ms = yhat80 - mult*se80
> u80ms = yhat80 + mult*se80
> cat(l30ms, u30ms, l60ms, u60ms, l80ms, u80ms,"\n")
10.28429 15.51789 23.83195 26.94008 31.39194 36.02665
IF THE TEXT FILE WITH THE COMMANDS IS IN f:/s505/r/kishi.R and YOU USE
source("f:/s505/r/kishi.R")
HERE IS WHAT YOU GET IN THE CONSOLE. THERE ARE WAYS TO
LABEL THE OUTPUT WITH THE VARIABLE NAMES THAT I’M NOT SHOWING YOU NOW.
----------------------------------------------------------------------------------
0.4161642 0.4161642 3.293353 0.0008880204 -0.05106117 11.0774
intervals at X = 31.6
confidence interval 13.56695 0.9762317 11.57033 15.56357
prediction interval 13.56695 3.46849 6.473092 20.66081
Simultaneous 95% ci's on beta0 and beta 1
-3.873648 4.705977 0.3457223 0.486606
SIMULTANEOUS CONFIDENCE INTERVALS ON THE MEAN/EXPECTED VALUE
FOR BALANCE AT intake = 30,60 and 80
using Bonferroni
11.40117 14.40101 24.49524 26.27679 32.38102 35.03758
USING SCHEFFE
10.28429 15.51789 23.83195 26.94008 31.39194 36.02665
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- cil realty of massachusetts inc
- commonwealth of massachusetts phone number
- university of massachusetts amherst online
- state of massachusetts withholding
- list of massachusetts dispensaries
- commonwealth of massachusetts address
- commonwealth of massachusetts dpu
- university of massachusetts online classes
- university of massachusetts online programs
- commonwealth of massachusetts boston ma
- commonwealth of massachusetts long form
- commonwealth of massachusetts insurance