Wednesday, January 26, 2011

Transformation for CI construction

To facilitate construction of confidence intervals, it is common to transform parameters. Delta method can he used to derive the approximate variance in that case. Here is the general theory for logarithmic transformed parameters:




Similarly, other transformations can be used. Other than logarithms, complementary log-log also has some advantages.

Some of these popular transformations are implemented in R:


> N = 28
> x= 17  
> p = x/N
> library("binom")
> binom.confint(x, N, conf.level=0.95, methods="agresti-coull")
         method  x  n      mean     lower     upper
1 agresti-coull 17 28 0.6071429 0.4236592 0.7647744
> binom.confint(x, N, conf.level=0.95, methods="wilson")
  method  x  n      mean     lower     upper
1 wilson 17 28 0.6071429 0.4240904 0.7643431
> binom.confint(x, N, conf.level=0.95, methods="bayes")
  method  x  n      mean     lower     upper
1  bayes 17 28 0.6034483 0.4230935 0.7702817
> binom.bayes(x, N, conf.level=0.95)
  method  x  n shape1 shape2      mean     lower     upper  sig
1  bayes 17 28   17.5   11.5 0.6034483 0.4230935 0.7702817 0.05
> binom.confint(x, N, conf.level=0.95, methods="logit")
  method  x  n      mean     lower     upper
1  logit 17 28 0.6071429 0.4199214 0.7674079
> binom.confint(x, N, conf.level=0.95, methods="cloglog")
   method  x  n      mean     lower     upper
1 cloglog 17 28 0.6071429 0.4038994 0.7598402
> binom.confint(x, N, conf.level=0.95, methods="probit")
  method  x  n      mean     lower     upper
1 probit 17 28 0.6071429 0.4212743 0.7710758
> binom.confint(x, N, conf.level=0.95, methods="profile")
   method  x  n      mean     lower     upper
1 profile 17 28 0.6071429 0.4227475 0.7727057 

1 comment:

  1. TITanium Diving Knife - Titsanium Art
    A high-tech Diving Knife made head titanium tennis racket of steel, with a where to buy titanium trim metal sia titanium blade and a knurled handle. Titsanium Art. titanium for sale $15.99 ceramic vs titanium · Amazon.com · Amazon.com

    ReplyDelete