similar to: Estimation of S.E. based on bootstrapping (functions with two or more arguments)

Displaying 20 results from an estimated 100 matches similar to: "Estimation of S.E. based on bootstrapping (functions with two or more arguments)"

2009 Apr 10
3
turning list into vector/dataframe
Hi, I have used this command : resamples<-lapply(1:1000,function(i) sample(lambs,replace=F)) resamples2<-lapply(resamples,Cusum) to get a list of 1000 samples of my data. The function Cumsum is defined as follows: Cusum<-function(x){ SUM<-cumsum(x)-(1:length(x))*mean(x) min<-min(cumsum(x)-(1:length(x))*mean(x)) max<-max(cumsum(x)-(1:length(x))*mean(x)) diff<-max-min
2013 Feb 07
1
Saving model and other objects from caret
Say I train a model in caret, e.g.: RFmodel <- train(X,Y,method='rf',trControl=myCtrl,tuneLength=1) How can I save this to disk and load it later in R? How about an object of the class "resamples"? resamps <- resamples( list( RF = RFmodel, SVM = SVMmodel, KNN = KNNmodel, NN = NNmodel )) Thanks,
2005 Sep 16
1
Add lines to density plot
Dear List, I am using R to learn bootstrapping concepts. Not to be oblivious to the contributed packages of boot and bootstrap, I have opted to do the following as a way to hone my R skills. One example I am trying to work through is the following: x <- 1:20 Observed <- sample(x,20) Resamples <- replicate(1000,sample(Observed,replace=TRUE)) Boot.Means <- apply(Resamples,2,mean)
2010 Sep 29
2
resampling issue
I am trying to get R to resample my dataset of two columns of age and length data for fish. I got it to work, but it is not resampling every replicate. Instead, it resamples my data once and then repeated it 5 times. Here is my dataset of 9 fish samples with an age and length for each one: Age Length 2 200 5 450 6 600 7 702 8 798 5 453 4 399 1 120 2 202 Here is my code which resamples my
2010 Jul 12
1
Robust regression error: Too many singular resamples
Hello. I've got a dataset that may have outliers in both x and y. While I am not at all familiar with robust regression, it looked like the function lmrob in package robustbase should handle this situation. When I try to use it, I get: Too many singular resamples Aborting fast_s_w_mem() Looking into it further, it appears that for an indicator variable in one of my interaction terms, 98%
2007 Nov 20
1
Problem with code for bootstrapping chi square test with count data
Hi, I'd like some advice on bootstrapping in R. I have a species x with 20 individuals and a factor containing 0 and 1's (in this case 5 zeros and 15 ones). I want to compare the frequency of the occurrence of 1 with a probability value. This code seems to work to do this in R. attach(test) p <- c(0.5272, (1-0.5272)) sp1_1 <- length(subset(x, x==1)) sp1_0 <- length(subset(x,
2012 Feb 28
7
indexing??
Hello All, My algorithm as follows; y <- c(1,1,1,0,0,1,0,1,0,0) x <- c(1,0,0,1,1,0,0,1,1,0) n <- length(x) t <- matrix(cbind(y,x), ncol=2) z = x+y for(j in 1:length(x)) { out <- vector("list", ) for(i in 1:10) { t.s <- t[sample(n,n,replace=T),] y.s <- t.s[,1] x.s <- t.s[,2] z.s <- y.s+x.s out[[i]] <- list(ff <- (z.s), finding=any (y.s==y[j])) kk
2013 Mar 12
1
Bootstrap BCa confidence limits with your own resamples
I like to bootstrap regression models, saving the entire set of bootstrapped regression coefficients for later use so that I can get confidence limits for a whole set of contrasts derived from the coefficients. I'm finding that ordinary bootstrap percentile confidence limits can provide poor coverage for odds ratios for binary logistic models with small N. So I'm exploring BCa confidence
2005 Dec 15
1
precision of rnorm
How many distinct values can rnorm return? I assume that rnorm manipulates runif in some way, runif uses the Mersenne Twister, which has a period of 2^19937 - 1. Given that runif returns a 64 bit precision floating point number in [0,1], the actual period of the Mersenne Twister in a finite precision world must be significantly less. One of the arguments for Monte Carlo over the bootstrap is
2012 Oct 08
0
Mininum number of resamples required to do BCa bootstrap?
I'm using R 2.15.1 on a 64-bit machine with Windows 7 Home Premium and package 'boot'. I've found that using a number of bootstrap resamples in boot() that is less than the number of data results in a fatal error. Once the number of resamples meets or exceeds the number of data, the error disappears. Sample problem (screwy subscripted syntax is a relic of edited down a more
2008 Dec 03
1
help on tapply using sample with differing sample-sizes
Hello, My question likely got buried so I am reposting it in the hopes that someone has an answer. I have thought more about the question and modified my question. I hope tha my specific question is: I am attempting to create a bootstrap procedure for a finite sample using the theory of Rao and Wu, JASA (1988) that replicates within each strata (h) n_h - 1 times. To this end, I require a
2005 Jun 21
2
Problem trying to use boot and lme together
The outcome variable in my dataset is cost. I prefer not to transform it as readers will really be interested in pounds, not log(pounds) or sqrt(pounds). I have fitted my model using lme and now wish to use boot on it. I have therefore plagiarised the example in the article in RNews 2/3 December 2002 after loading the dataset I source this file
2007 Aug 16
1
(coxph, se) Obtaining standard errors of coefficients from coxph to store
Hi all, I'm wanting to be able to find and store the z-score of coxph below: - modz=coxph(Surv(TSURV,STATUS)~RAGE+DAGE+REG_WTIME_M+CLD_ISCH+POLY_VS, data=kidneyT,method="breslow") I know summary(modz) will give me this, but how do i extract the standard error or z-score values in a similar way to obtaining the coefficients by coef(modz) ? I think it must be something to do with
2007 Aug 06
1
(Censboot, Z-score, Cox) How to use Z-score as the statistic within censboot?
Dear R Help list, My question is regarding extracting the standard error or Z-score from a cph or coxph call. My Cox model is: - modz=cph(Surv(TSURV,STATUS)~RAGE+DAGE+REG_WTIME_M+CLD_ISCH+POLY_VS, data=kidneyT,method="breslow", x=T, y=T) I've used names(modz) but can't see anything that will let me extract the Z scores for each coefficient or the standard errors in the same
2012 Oct 02
0
Possible error in BCa method for confidence intervals in package 'boot'
I'm using R 2.15.1 on a 64-bit machine with Windows 7 Home Premium. Sample problem (screwy subscripted syntax is a relic of edited down a more complex script): > N <- 25 > s <- rlnorm(N, 0, 1) > require("boot") Loading required package: boot > v <- NULL # hold sample variance estimates > i <- 1 > v[i] <- var(s) # get sample variance >
2007 May 25
1
Speeding up resampling of rows from a large matrix
I'm trying to: Resample with replacement pairs of distinct rows from a 120 x 65,000 matrix H of 0's and 1's. For each resampled pair sum the resulting 2 x 65,000 matrix by column: 0 1 0 1 ... + 0 0 1 1 ... _______ = 0 1 1 2 ... For each column accumulate the number of 0's, 1's and 2's over the resamples to obtain a 3 x 65,000 matrix G. For those
2010 Nov 16
2
Counting
Hi dear all, i have a data (data.frame) which contain y and x coloumn(i.e. y x 1 0.58545723 0.15113102 2 0.02769361 -0.02172165 3 1.00927527 -1.80072610 4 0.56504053 -1.12236685 5 0.58332337 -1.24263981 6 -1.70257274 0.46238255 7 -0.88501561 0.89484429 8 1.14466282 0.34193875 9 0.58827457 0.15923694 10 -0.79532232 -1.44193770 ) i changed
2003 Jan 31
1
Problems with boot package (empinf returns NA)
Hi I'm using boot package for some analysis on linear regression coeficients. My problem is that I can not compute bca intervals, I get an error message > bca.ci(blm8901,index=1) Error in if (!all(rk > 1 & rk < R)) warning("Extreme Order Statistics used as Endpoints") : missing value where logical needed The problem is the empinf.reg function that is
2009 May 26
0
Bootstrapping and estimation of standard error
Hello, I've started using R few months ago and I really like it. I need to estimate standard deviation of certain statistics (some measures of poverty). I found a really simple program, and I just need to check whether it's OK and really calculates what it's supposed to. Let's suppose e. g. head-count index (as one of the simplest measures of poverty) which is calculated as a
2017 Aug 19
2
bootstrap subject resampling: resampled subject codes surface as list/vector indices
I'm implementing a custom bootstrap resampling procedure in R. This procedure resamples clusters of data points obtained by different subjects in an experiment. Since the bootstrap samples need to have the same size as the original dataset, `target.set.size`, I select speakers compute their data point contributions to make sure I have a set of the right size. set.seed(1)