thz.ch
> > Subject: Re: [R] How can I overwrite a method in R?
> >
> > This is usually ill-advised, but I think it's the right solution for
> > your problem:
> >
> > assignInNamespace("plot.histogram", function(...) plot(1:10), "graphics")
> > hi
How can I create an improved version of a method in R, and have it be used?
Short version:
I think plot.histogram has a bug, and I'd like to try a version with a fix.
But when I call hist(), my fixed version doesn't get used.
Long version:
hist() calls plot() which calls plot.histogram() which fa
>Le mercredi 12 septembre 2012 à 07:08 -0700, Tim Hesterberg a écrit :
>> One approach is to bootstrap the vector 1:n, where n is the number
>> of individuals, with a function that does:
>> f <- function(vectorOfIndices, theTable) {
>> (1) create a new table with
of interest on the new table.
}
When f is called with 1:n, the table it creates should be the same
as the original table. When called with a bootstrap sample of
values from 1:n, it should create a table corresponding to the
bootstrap sample.
Tim Hesterberg
http://www.timhesterberg.net
(resampl
bootstrap and jackknife methods won't work right.
Tim Hesterberg
http://www.timhesterberg.net
New: Mathematical Statistics with Resampling and R, Chihara & Hesterberg
>On Fri, Aug 31, 2012 at 12:15 PM, David L Carlson wrote:
>
>> Using a data.frame x with columns bin
cing an illegal data frame
* round(a data frame with numeric and factor columns)
rounds the numeric columns and leaves the factor columns unchanged, rather
than failing.
Tim Hesterberg
NEW! Mathematical Statistics with Resampling and R, Chihara & Hesterberg
http://www.amazon.com/Mathematic
there could be 0, 1, 2,
The permutation test answers the question - given that there is exactly
1 outlier in my combined data, what is the probability that random chance
would give a difference as large as I observed. The bootstrap would
answer some other question.
Tim Hesterberg
NEW! Mathematic
'print.boot' is not an exported object from 'namespace:boot'").
Tim Hesterberg
>Do
> names(bootObj)
>to find out what the components are, and use $ or [[ to extract
>components.
>Do
> help(boot)
>for a description of components of the object (look in th
(), return lists with
a class added, and you can operate on the object as a list using
names(), $, etc.
Tim Hesterberg
>Dear R user,
>
>I used the following to do a bootstrap.
>
>
>>bootObj<-boot(data=DAT, statistic=Lp.est,
>R=1000,x0=3)
>
>I have the following output f
other methods have their own biases, particularly in nonlinear
applications such as logistic regression.
Tim Hesterberg
>Thank you for your reply, Prof. Harrell.
>
>I agree with you. Dropping only one variable does not actually help a lot.
>
>I have one more question.
>During a
efficients estimated from the original data.
And, you can compute the model matrix once and resample rows of that
along with y, rather than computing a model matrix from scratch each time.
Tim Hesterberg
>The only reason the boot package will take more memory for 2000
>replications than 10 is
terval is the range of the middle 95% of
the recorded differences.
Tim Hesterberg
P.S. I think you're mixing up the response and explanatory variables.
I'd think of eating hot dogs as the cause (explanatory variable),
and waistline as the effect (response, or outcome).
P.P.S. I don't
>Can someone help me about detection of outliers using jackknife after
>bootstrap algorithm?
A simple procedure is to calculate the mean of the bootstrap
statistics for all bootstrap samples that omit the first of the
original observations. Repeat for the second, third, ... original
observation.
al Association, 2924-2930.
http://home.comcast.net/~timhesterberg/articles/JSM04-bootknife.pdf
All three are undefined for samples of size 1. You need to go to some
other bootstrap, e.g. a parametric bootstrap with variability estimated
from other data.
Tim Hesterberg
Upper <- (1 + sum(permutationDistribution >= theta)) / (r+1)
pValueTwosided <- 2 * min(pValueLower, pValueUpper)
Tim Hesterberg
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting gu
I've defined my own version of summary.default,
that gives a better summary for highly skewed vectors.
If I call
summary(x)
the method is used.
If I call
summary(data.frame(x))
the method is not used.
I've traced this to lapply; this uses the new method:
lapply(list(x), function(x) summary
rap is used for inference
(bias, standard error, confidence intervals), not improving on
ThetaHat.
Tim Hesterberg
>Hi Doran,
>
>Maybe I am wrong, but I think bootstrap is a general resampling method which
>can be used for different purposes...Usually it works well when you do not
>have a
rican Statistical Association, 2924-2930.
http://home.comcast.net/~timhesterberg/articles/JSM04-bootknife.pdf
Tim Hesterberg
(formerly of Insightful, now Google, and only now catching up on R-help)
> Hi Dan,
>
> Thanks for response yes i do know that bootstrap samples generated by
> fun
v <- V[[i]]
u[u >= range(v)[1] & u <= range(v)[2]]
},
U = u, V = v)
Tim Hesterberg
>I want to apply this function to the columns of a data frame:
>
>u[u >= range(v)[1] & u <= range(v)[2]]
>
>where u is the n column da
any(!is.na(x
# 3.33
# larger data frame
x <- matrix(runif(10^5), 10^3)
x[ runif(10^5) < .99 ] <- NA
df2 <- data.frame(x)
system.time( for(i in 1:100) temp <- rowSums(is.na(df2)) < 100)
# .34
system.time( for(i in 1:10^4) temp <- apply(df,1,function(x)any(!i
putting to sea in a
rowing boat to find out whether conditions are sufficiently calm for
an ocean liner to leave port." (G.E.P. Box, "Non-normality and tests
on variances", Biometrika, 40 (1953), pp 318-335, quote on page 333;
via from Moore & McCabe.
Tim Hesterberg
>Dear
Thomas Lumley wrote:
>On Wed, 6 Feb 2008, Tim Hesterberg wrote:
>
>>> Tim Hesterberg wrote:
>>>> I'll raise a related issue - sampling with unequal probabilities,
>>>> without replacement. R does the wrong thing, in my opinion:
>>>> ...
&
>Tim Hesterberg wrote:
>>I'll raise a related issue - sampling with unequal probabilities,
>>without replacement. R does the wrong thing, in my opinion:
>>...
>Peter Dalgaard wrote:
>But is that the right thing? ...
(See bottom for more of the previous messages.)
should be proportional
to size*prob = c(.3,.6,.9,1.2). That isn't possible when sampling
without replacement. Sampling with minimal replacement allows this;
observation 4 is included in every sample, and is included twice in
20% of the samples.
Tim Hesterberg
Disclaimer - these are my opinions
ist( x = ends,
y = c(0,h*cumsum(colSums( matrix( wt*f(c(xvalues), ...), 10)
}
Tim Hesterberg
>On 22/01/2008 5:30 AM, Thomas Steiner wrote:
>> I want to use a function as an argument to ingtegrate it twice.
>> ...
Duncan Murdoch wrote:
>...
>The other problem is that in
that depend only
on y.
The answer to your second question is the same as the first - sample
blocks of observations, keeping x and y together.
Tim Hesterberg
>Hello.
>
>I have got two problems in bootstrapping from
>dependent data sets.
>
>Given
I wrote the original rowSums (in S-PLUS).
There, rowSums() does not coerce integer to double.
However, one advantage of coercion is to avoid integer overflow.
Tim Hesterberg
>... So, why does rowSums() coerce to double (behaviour
>that is undesirable
27 matches
Mail list logo