s-news
[Top] [All Lists]

Re: limits.tilt and weights

To: Kim.Elmore@noaa.gov
Subject: Re: limits.tilt and weights
From: Tim Hesterberg <TimHesterberg@gmail.com>
Date: Mon, 13 Apr 2009 21:12:12 -0700
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <73074920.49207307@noaa.gov> (Kim.Elmore@noaa.gov)
References: <73074920.49207307@noaa.gov>
Reply-to: TimHesterberg@gmail.com (Tim Hesterberg)
There are some techniques described in:
Ellis, Stephen J. and Tim C. Hesterberg (1999), "Computation of
Weighted Functional Statistics Using Software That Does Not Support
Weights", Technical Report No. 85, Research Department, MathSoft,
Inc., 1700 Westlake Ave. N., Suite 500, Seattle, WA 98109.
http://home.comcast.net/~timhesterberg/articles/tech85-weightedFunc.pdf

The techniques described there are not included in the S+Resample
library.  A quick-and-dirty implementation of the first technique there
would be to write a function:

f <- function(data, ..., weights = NULL){
  if(is.null(weights)) {
    theRealStatistic(data, ...)
  } else {
    n <- length(weights) # This should equal the number of observations
    theRealStatistic(data[rep(1:n, round(100*weights/mean(weights))),], ...)
  }
}

and pass that as the statistic to bootstrap().
Changing 100 to a larger number would improve accuracy at the expense
of speed and memory.

Tim Hesterberg

>I'm trying to figure out how to use limits.tilt when my original
>statistic doesn't include any weights.  I compute various 2x2
>contingency table statistics, and would like to use limits.tilt to get a
>better CI for them. Unfortunately, the stats that I compute don't
>include any weights. In the past, I've kludged in some phantom weights
>such that there is a place holder for them in limits.tilt, but that's
>not very satisfying and can be difficult if I didn't write the function. 
>
>I've read the help, and have tried various things, but I can't seem to
>get anything to work. So, I appeal to people a lot smarter than I am: in
>general, if my statistic does not include any "weights," how can I
>satisfy the requirement for them in limits.tilt?
>
>Kim Elmore


<Prev in Thread] Current Thread [Next in Thread>