Re: [R] bootstrap CI of the difference between 2 Cramer's V

2022-06-05 Thread Daniel Nordlund
There are a few problems with the "rewrite" of the code, both syntactically and conceptually. 1. Goodman-Kruskal gamma is for ordinal data.  You should create your "shopping" and "statut" variables as factors, ordered from lowest to highest using the levels= parameter in  the function, factor 2.

Re: [R] bootstrap CI of the difference between 2 Cramer's V

2022-06-04 Thread Ebert,Timothy Aaron
tations is not good. Tim -Original Message- From: R-help On Behalf Of Daniel Nordlund Sent: Saturday, June 4, 2022 3:31 AM To: varin sacha ; r-help@r-project.org Subject: Re: [R] bootstrap CI of the difference between 2 Cramer's V [External Email] On 5/28/2022 11:21 AM, varin sacha v

Re: [R] bootstrap confidence intervals

2021-11-08 Thread varin sacha via R-help
Hi, Many thanks for your responses. Le samedi 6 novembre 2021, 08:39:22 UTC+1, Rui Barradas a écrit : Hello, Às 01:36 de 06/11/21, David Winsemius escreveu: > > On 11/5/21 1:16 PM, varin sacha via R-help wrote: >> Dear R-experts, >> >> Here is a toy example. How can I get the bootst

Re: [R] bootstrap confidence intervals

2021-11-08 Thread varin sacha via R-help
Hi, I really thank you a lot for your response. Le samedi 6 novembre 2021, 02:37:46 UTC+1, David Winsemius a écrit : On 11/5/21 1:16 PM, varin sacha via R-help wrote: > Dear R-experts, > > Here is a toy example. How can I get the bootstrap confidence intervals > working ? > > Many th

Re: [R] bootstrap confidence intervals

2021-11-06 Thread Rui Barradas
Hello, Às 01:36 de 06/11/21, David Winsemius escreveu: On 11/5/21 1:16 PM, varin sacha via R-help wrote: Dear R-experts, Here is a toy example. How can I get the bootstrap confidence intervals working ? Many thanks for your help library(DescTools) library(boo

Re: [R] bootstrap confidence intervals

2021-11-05 Thread David Winsemius
On 11/5/21 1:16 PM, varin sacha via R-help wrote: Dear R-experts, Here is a toy example. How can I get the bootstrap confidence intervals working ? Many thanks for your help library(DescTools) library(boot) A=c(488,437,500,449,364) dat<-data.frame(A) med<-fu

Re: [R] Bootstrap P-Value

2020-11-06 Thread AbouEl-Makarim Aboueissa
Dear Greg: H0: Mean 1- Mean 2 = 0 Ha: Mean 1 - Mean 2 ! = 0 with many thanks abou __ *AbouEl-Makarim Aboueissa, PhD* *Professor, Statistics and Data Science* *Graduate Coordinator* *Department of Mathematics and Statistics* *University of Southern Maine* On Fri, Nov 6,

Re: [R] Bootstrap P-Value

2020-11-06 Thread Greg Snow
A p-value is for testing a specific null hypothesis, but you do not state your null hypothesis anywhere. It is the null value that needs to be subtracted from the bootstrap differences, not the observed difference. By subtracting the observed difference you are setting a situation where the p-val

Re: [R] bootstrap sample for clustered data

2018-09-18 Thread Jeff Newmiller
ay, September 17, 2018 2:32 AM >To: r-help@r-project.org; Liu, Lei ; >r-help@R-project.org >Subject: Re: [R] bootstrap sample for clustered data > >You are telling us that the ID values in your data set indicate >clusters. However you went about making that determination in the f

Re: [R] bootstrap sample for clustered data

2018-09-17 Thread Liu, Lei
---Original Message- From: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us] Sent: Monday, September 17, 2018 2:32 AM To: r-help@r-project.org; Liu, Lei ; r-help@R-project.org Subject: Re: [R] bootstrap sample for clustered data You are telling us that the ID values in your data set indicate

Re: [R] bootstrap sample for clustered data

2018-09-17 Thread Jeff Newmiller
You are telling us that the ID values in your data set indicate clusters. However you went about making that determination in the first place might be an obvious(?) way to do it again with your bootstrapped sample, ignoring the cluster assignments you have in place. This is the wrong place to ha

Re: [R] bootstrap sample for clustered data

2018-09-16 Thread Bert Gunter
5 1 0 0.4 > > 6 1 0 1.0 > > 7 1 0 0.9 > > 1 2 0 0.5 > > 2 2 0 0.6 > > 11 3 1 2.2 > > 12 3 1 3.0 > > 3 4 1 0.4 > > 4 4 1 0.3 > > 13 5 0 0.5 > > 21 5 0 0.6 > > > > Can you help me with it? Thanks a lot! > > &g

Re: [R] bootstrap sample for clustered data

2018-09-16 Thread Liu, Lei
, Lei Cc: R-help Subject: Re: [R] bootstrap sample for clustered data I can't make any sense of your post. Id 3 occurs 6 times, and 2 and 5 occur twice each in your example.. How do you get (1,1,2,2,3,3,4,4,5,5) out of that? In other words, specify the mapping of old id's to new. Bert B

Re: [R] bootstrap sample for clustered data

2018-09-16 Thread Bert Gunter
wrote: > >> Sorry for the confusion. I just want to recode the id variable to 1 to 5 >> in the bootstrapped sample. This way I can do e.g., a mixed effects model >> using the new id as the cluster. Thanks! >> >> Lei >> >> >> >> *From:* Bert G

Re: [R] bootstrap sample for clustered data

2018-09-16 Thread Bert Gunter
I can't make any sense of your post. Id 3 occurs 6 times, and 2 and 5 occur twice each in your example.. How do you get (1,1,2,2,3,3,4,4,5,5) out of that? In other words, specify the mapping of old id's to new. Bert Bert Gunter "The trouble with having an open mind is that people keep coming alo

Re: [R] Bootstrap and average median squared error

2018-05-23 Thread varin sacha via R-help
Hi Rui and Daniel, Many thanks for your responses. It perfectly works. Best, Le mardi 22 mai 2018 à 12:47:14 UTC+2, Rui Barradas a écrit : Hello, Right! I copied from the OP's question without thinking about it. Corrected would be bootMedianSE <- function(data, indices){     d <- d

Re: [R] Bootstrap and average median squared error

2018-05-22 Thread Rui Barradas
Hello, Right! I copied from the OP's question without thinking about it. Corrected would be bootMedianSE <- function(data, indices){ d <- data[indices, ] fit <- rq(crp ~ bmi + glucose, tau = 0.5, data = d) ypred <- predict(fit) y <- d$crp median((y - ypred)^2) } Sorry, rui

Re: [R] Bootstrap and average median squared error

2018-05-22 Thread Daniel Nordlund
On 5/22/2018 2:32 AM, Rui Barradas wrote: bootMedianSE <- function(data, indices){ d <- data[indices, ] fit <- rq(crp ~ bmi + glucose, tau = 0.5, data = d) ypred <- predict(fit) y <- d$crp median(y - ypred)^2 } since the OP is looking for the "median squared error"

Re: [R] Bootstrap and average median squared error

2018-05-22 Thread Rui Barradas
I forgot, you should also set.seed() before calling boot() to make the results reproducible. Rui Barradas On 5/22/2018 10:00 AM, Rui Barradas wrote: Hello, If you want to bootstrap a statistic, I suggest you use base package boot. You would need the data in a data.frame, see how you could do

Re: [R] Bootstrap and average median squared error

2018-05-22 Thread Rui Barradas
Hello, If you want to bootstrap a statistic, I suggest you use base package boot. You would need the data in a data.frame, see how you could do it. library(boot) bootMedianSE <- function(data, indices){ d <- data[indices, ] fit <- rq(crp ~ bmi + glucose, tau = 0.5, data = d) ypred

Re: [R] Bootstrap analysis from a conditional logistic regression

2017-11-13 Thread David Winsemius
> On Nov 13, 2017, at 2:01 PM, Nelly Reduan wrote: > > Nelly Reduan a partag� un fichier OneDrive avec vous. Pour l�afficher, > cliquez sur le lien ci-dessous. > > > > [https://r1.res.office365.com/owa/prem/images/dc-png_20.png]

Re: [R] bootstrap subject resampling: resampled subject codes surface as list/vector indices

2017-08-19 Thread Aleksander Główka
Thank you and apologies for not having posted the data along with the code. After poking some more, I found the bug. I first initialize sample.subjects as an an empty list: sample.subjects = list() And then I try to the first element of that empty list. sample.subjects[1] = sample(unique(data

Re: [R] bootstrap subject resampling: resampled subject codes surface as list/vector indices

2017-08-19 Thread Bert Gunter
I din't have the patience to go through your missive in detail, but do note that it is not reproducible, as you have not provided a "data" object. You **are** asked to provide a small reproducible example by the posting guide. Of course, others with more patience and/or more smarts may not need th

Re: [R] Bootstrap using ARIMA model

2016-12-03 Thread David Winsemius
> On Dec 1, 2016, at 1:58 PM, Ashwini Patil wrote: > > Hi David, > > here is my code including what i did for the tsboot: > rm(list = ls()) > library(boot) > library(tseries) > library(TTR) > library(quantmod) > library(scales) > library(forecast) > library(zoo) > library(TSA) > security<-"NFLX

Re: [R] Bootstrap using ARIMA model

2016-12-01 Thread Ashwini Patil
Hi David, here is my code including what i did for the tsboot: rm(list = ls()) library(boot) library(tseries) library(TTR) library(quantmod) library(scales) library(forecast) library(zoo) library(TSA) security<-"NFLX" startDate<-"2012-06-01" endDate<-"2016-10-31" qte_list<-c("AdjClose") data=get.

Re: [R] Bootstrap using ARIMA model

2016-12-01 Thread Bert Gunter
Just briefly to follow up David's comment, though this is mainly about statistics and therefore off topic here... Bootstrapping time series is a subtle issue that requires familiarity with the technical details-- and maybe even current research. The tsboot() function gives you several options from

Re: [R] Bootstrap using ARIMA model

2016-12-01 Thread David Winsemius
> On Dec 1, 2016, at 7:45 AM, Ashwini Patil wrote: > > Hi, > > I want to implement a bootstrap method for time series. > I am taking the adj close values from yahoo for NFLX and now I need to > bootstrap these values using ARIMA model. > > here is my code so far: > rm(list = ls()) > library(bo

Re: [R] Bootstrap Methods for Confidence Intervals -- glmnet

2016-05-12 Thread Bert Gunter
Lorenzo: This is a complicated and subtle question that I believe is mostly about statistical methodology, not R. I would suggest that you post your query to stats.stackexchange.com rather than here in order to determine *what* you should do. Then, if necessary, you can come back here to ask about

Re: [R] bootstrap glm

2016-02-29 Thread Adams, Jean
​It's helpful if you post example data with your question, so R-help readers can easily test your code​. I created a fake data set with two x variables for testing. It's also helpful if you list the necessary packages. I assume that used the boot package. You are dealing with two kinds of indic

Re: [R] Bootstrap library(boot) "boot.ci" function

2015-01-17 Thread David Winsemius
Moderator’s note; There were two messages from this person in the moderation queue and since they appeared identical in the moderation panel, I accepted accepted one and rejected the other. I’m now wondering (and have no way of checking) whether the OP sent a second non-HTML version and I reject

Re: [R] Bootstrap CIs for weighted means of paired differences

2014-11-22 Thread i.petzev
Ok, thanks for the suggestions. I will look into that. And you are absolutely right that I should have been more clear about what type of weighting I want. So to clarify: I run time series regressions of returns of company i on two different sets of explanatory variables. Then I extract the resp

Re: [R] Bootstrap CIs for weighted means of paired differences

2014-11-22 Thread i.petzev
On 21 Nov 2014, at 19:18, David Winsemius wrote: > > On Nov 21, 2014, at 6:52 AM, ivan wrote: > >> I am aware of the fact that bootstrapping produces different CIs with every >> run. I still believe that there is a difference between both types of >> procedures. My understanding is that sett

Re: [R] Bootstrap CIs for weighted means of paired differences

2014-11-21 Thread David Winsemius
On Nov 21, 2014, at 6:52 AM, ivan wrote: > I am aware of the fact that bootstrapping produces different CIs with every > run. I still believe that there is a difference between both types of > procedures. My understanding is that setting "w" in the boot() function > influences the "importance"

Re: [R] Bootstrap CIs for weighted means of paired differences

2014-11-21 Thread ivan
I am aware of the fact that bootstrapping produces different CIs with every run. I still believe that there is a difference between both types of procedures. My understanding is that setting "w" in the boot() function influences the "importance" of observations or how the bootstrap selects the obse

Re: [R] Bootstrap CIs for weighted means of paired differences

2014-11-20 Thread David Winsemius
On Nov 20, 2014, at 2:23 AM, i.petzev wrote: > Hi David, > > sorry, I was not clear. Right. You never were clear about what you wanted and your examples was so statistically symmetric that it is still hard to see what is needed. The examples below show CI's that are arguably equivalent. I can

Re: [R] Bootstrap CIs for weighted means of paired differences

2014-11-20 Thread i.petzev
Hi David, sorry, I was not clear. The difference comes from defining or not defining �w� in the boot() function. The results with your function and your approach are thus: set.seed() x <- rnorm(50) y <- rnorm(50) weights <- runif(50) weights <- weights / sum(weights) dataset <- cbind(x,y,we

Re: [R] Bootstrap CIs for weighted means of paired differences

2014-11-19 Thread David Winsemius
On Nov 19, 2014, at 6:08 AM, i.petzev wrote: > Hi David, > > thanks a lot for the response. I see that this works. I am not sure, however, > what the appropriate way to do this is. It also works if you do not define > weights in the boot() function (weighted bootstrap) but rather in the > vw_

Re: [R] Bootstrap CIs for weighted means of paired differences

2014-11-19 Thread i.petzev
Hi David, thanks a lot for the response. I see that this works. I am not sure, however, what the appropriate way to do this is. It also works if you do not define weights in the boot() function (weighted bootstrap) but rather in the vw_m_diff function (ordinary bootstrap), i.e., vw_m_diff <-

Re: [R] Bootstrap CIs for weighted means of paired differences

2014-11-15 Thread David Winsemius
On Nov 14, 2014, at 3:18 PM, David Winsemius wrote: > > On Nov 14, 2014, at 12:15 PM, ivan wrote: > >> Hi, >> >> I am trying to compute bootstrap confidence intervals for weighted means of >> paired differences with the boot package. Unfortunately, the weighted mean >> estimate lies out of the

Re: [R] Bootstrap CIs for weighted means of paired differences

2014-11-14 Thread David Winsemius
On Nov 14, 2014, at 12:15 PM, ivan wrote: > Hi, > > I am trying to compute bootstrap confidence intervals for weighted means of > paired differences with the boot package. Unfortunately, the weighted mean > estimate lies out of the confidence bounds and hence I am obviously doing > something wro

Re: [R] Bootstrap (bootSem) causes R to crash

2013-10-11 Thread Eric Green
is is indeed the source of the problem, I should > > > probably avoid the Tk progress bar under Mac OS X because of the > > > inadequate > > > support out of the box for the tcltk package on that platform. > > > > > > Best, > > > John &g

Re: [R] Bootstrap (bootSem) causes R to crash

2013-10-10 Thread Eric Green
> > John Fox > > Senator McMaster Professor of Social Statistics > > Department of Sociology > > McMaster University > > Hamilton, Ontario, Canada > > > > > > > > > > > > > -Original Message- > > &

Re: [R] Bootstrap (bootSem) causes R to crash

2013-10-10 Thread Eric Green
stics > Department of Sociology > McMaster University > Hamilton, Ontario, Canada > > > > > > > -Original Message- > > From: r-help-...@r-project.org > > [mailto:r-help-...@r- > > project.org] On Behalf Of pedroabg > > Sent: Wednesday, M

Re: [R] bootstrap

2013-05-29 Thread arun
Hi, I am not sure if this is what you wanted. set.seed(125)  simdata<- replicate(S,generate(500)) set.seed(125) data1<- generate(500)  data2<- replicate(S,as.data.frame(t(sample(as.data.frame(t(data1)),100,replace=TRUE  dim(data2) #[1]   12 1000  data2[1:5,1:5] #   [,1]    [,2]   

Re: [R] bootstrap

2013-05-29 Thread arun
Hi, Don't know if this helps: set.seed(244)  data1<- generate(10) data1     x1    x2 x3 x4  x5 x6 1  -0.89558948 -0.5609722069 -1.0782688 -1.2461548 -0.58857050  1.5708187 2  -0.82379187 -0.9056306209 -1.5700755 -0.6045090 -0.19683863 -0.8969354 3

Re: [R] bootstrap

2013-05-29 Thread Bert Gunter
library(boot) is wholly unnecessary. Hint: 1000 * 5 = 5000 ?sample -- Bert On Wed, May 29, 2013 at 6:15 AM, arun wrote: > Hi, > You might need to check library(boot). I have never used that before. So, I > can't comment much. It is better to post on R-help list. I had seen your > postin

Re: [R] bootstrap

2013-05-29 Thread arun
Hi, You might need to check library(boot).  I have never used that before.  So, I can't comment much.  It is better to post on R-help list.  I had seen your postings on Nabble in the past.  Unfortunately those postings were not accepted in R-help.  You have to directly post at   r-help@r-project

Re: [R] Bootstrap (bootSem) causes R to crash

2013-03-20 Thread John Fox
ounces@r- > project.org] On Behalf Of pedroabg > Sent: Wednesday, March 20, 2013 1:18 PM > To: r-help@r-project.org > Subject: Re: [R] Bootstrap (bootSem) causes R to crash > > I think we didn't receive this on the list. > > > > -- > View this mess

Re: [R] Bootstrap (bootSem) causes R to crash

2013-03-20 Thread pedroabg
I think we didn't receive this on the list. -- View this message in context: http://r.789695.n4.nabble.com/Bootstrap-bootSem-causes-R-to-crash-tp4661900p4661944.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mai

Re: [R] Bootstrap encounter histories data

2013-03-14 Thread Rui Barradas
Hello, One more thing, if you have the data as strings of states/space/group, you can split it in vectors state/group with # This is your data example x <- c( "1100222101 1", "020010 3", "0010101022 2" ) mat <- do.call(rbind, strsplit(x, " ")) But this creates a matrix, so you'll need t

Re: [R] Bootstrap encounter histories data

2013-03-14 Thread Rui Barradas
Hello, It doesn't seem very complicated. First of all, for the function fun below to work, you need the data not as strings of staes followed by a space followed by a broup number, but in two columns vectors, a character vector of states and a vector of groups. The vector of groups can be of c

Re: [R] Bootstrap BCa confidence limits with your own resamples

2013-03-12 Thread John Fox
Dear Frank, > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Frank Harrell > Sent: Tuesday, March 12, 2013 2:24 PM > To: r-help@r-project.org > Subject: Re: [R] Bootstrap BCa confidence limits with yo

Re: [R] Bootstrap BCa confidence limits with your own resamples

2013-03-12 Thread Frank Harrell
That's very helpful John. Did you happen to run a test to make sure that boot.ci(..., type='bca') in fact gives the BCa intervals or that they at least disagree with percentile intervals? Frank John Fox wrote > Dear Frank, > > I'm not sure that it will help, but you might look at the bootSem()

Re: [R] Bootstrap BCa confidence limits with your own resamples

2013-03-12 Thread John Fox
Dear Frank, I'm not sure that it will help, but you might look at the bootSem() function in the sem package, which creates objects that inherit from "boot". Here's an artificial example: -- snip -- library(sem) for (x in names(CNES)) CNES[[x]] <- as.numeric(CNES[[x]]) model.cnes

Re: [R] bootstrap based confidence band

2012-12-06 Thread Rui Barradas
Hello, Inline. Em 06-12-2012 03:52, Rebecca escreveu: > I'm trying to find a bootstrap based confidence band for a linear model. > I have created a data set with X and Y > X=runif(n,-1.25,1.25) > e=rnorm(n,0,1) > Y=exp(3*X)+5*sin((30*X)/(2*pi))+2*e > fit=lm(Y~X) You cannot expect this model, a fi

Re: [R] Bootstrap and Jackknife Bias using Survey Package

2012-11-06 Thread John Cam
Dear Prof Lumley and Dear All, I've seen how to get parameter estimates in your previous message: R> a <- svymean(~api00,rclus1,return.replicates=TRUE) R> a$replicates [1] 642.5814 648.0168 646.2873 642.8824 645.1215 644.6369 646.9609 637.8084 640.7874 640.1007 642.7284 667.7329 638.3000 644.

Re: [R] bootstrap in time dependent Cox model?

2012-02-21 Thread Ehsan Karim
Thanks Prof. Terry for the response. To answer the second comment, the weights I am considering are inverse probability of treatment weights (IPTW). To perform bootstrapping, my initial thought would be to - select patients (sampling from unique id with replacement) and - then include all the mult

Re: [R] bootstrap in time dependent Cox model?

2012-02-21 Thread Terry Therneau
Two comments. I've not found bootstrapping worthwhile for Cox models. If one has 10-20 events per covariate and no outrageous coefficients (risks of >10 fold) the standard asymptotics are very good. With an multiple events AG model there is the additional consideration that no one subject is re

Re: [R] bootstrap means by strata

2011-10-13 Thread Tim Howard
Answering my own question. ?sample (!) y <- by(x, x$TrSeasYr, function(x) mean(sample(x[,1], size=999, replace = TRUE))) >>> Tim Howard 10/13/2011 9:42 AM >>> All - I have an uneven set of replicates and would like to sample from this set X number of times to generate a mean for each groupi

Re: [R] bootstrap function

2011-09-06 Thread Daniel Malter
install.packages("bootstrap") library(bootstrap) ? -- View this message in context: http://r.789695.n4.nabble.com/bootstrap-function-tp3794224p3795264.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Bootstrap

2011-07-21 Thread Matt Shotwell
In order to apply the bootstrap, you must resample, uniformly at random from the independent units of measurement in your data. Assuming that these represent the rows of 'data', consider the following: est <- function(y, x, obeta = c(1,1), verbose=FALSE) { n <- length(x) X <- cbind(rep(1,

Re: [R] Bootstrap

2011-07-20 Thread Weidong Gu
I didn't see bootstrap steps in your code. One way to modify your codes for (Ncount in 1:100) { b.data<-data[sample(1:nrow(data),replace=T),] y <-b.data[,1] x <-b.data[,2] n <- length(x) ... ### make appropriate changes if needed } Weidong Gu On Wed, Jul 20, 2011 at 6:09 PM, Val wrote: > Hi all

Re: [R] bootstrap vignette construction and package installation

2011-05-04 Thread Uwe Ligges
On 03.05.2011 22:20, Murat Tasan wrote: hi all - i'm trying to 'R CMD build' a package, but i have what appears to be a bootstrapping problem: i've included a vignette in my package, with R code interwoven (and built using Sweave), but in this documentation i have a code line: library(MyPackag

Re: [R] Bootstrap 95% confidence intervals for splines

2011-03-28 Thread mitchell wachtel
Dr Hesterberg: "Independent" and "dependent" were used for convenience. A person selling hot dogs would render "HD" the Y variable. The real cause of both WL and HD is likely hormonal derangement associated with diabetes. One other question. A log negative binomial regression m.ln<-glm.nb( Co

Re: [R] Bootstrap 95% confidence intervals for splines

2011-03-27 Thread Tim Hesterberg
You're mixing up two concepts here, - splines - bootstrap confidence intervals Separating them may help cut the confusion. First, to do a bootstrap confidence interval for a difference in predictions in the linear regression case, do: repeat 10^4 times draw a bootstrap sample of the observa

Re: [R] bootstrap

2011-03-06 Thread David Winsemius
On Mar 6, 2011, at 1:52 PM, Ashish Kumar wrote: In the boot package,consider a scalar function to boot. estimator <- function(x, d) { + mean(x[d]) + } data <- city$u b <- boot(data, estimator, R=1000) b$t0 [1] 64 ci <- boot.ci(b, type=c("bca"), conf=.95) ci$bca conf [1,] 0.95 49.44

Re: [R] bootstrap resampling - simplified

2011-03-02 Thread Jonathan P Daily
e Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 "Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it." - Jubal Early, Firefly Bert Gunter wrote on 03/02/2011 02:42:40 PM: > [image

Re: [R] bootstrap resampling - simplified

2011-03-02 Thread Bert Gunter
? Does the room, >  the thing itself have purpose? Or do we, what's the word... imbue it." >     - Jubal Early, Firefly > > r-help-boun...@r-project.org wrote on 03/02/2011 01:05:01 PM: > >> [image removed] >> >> Re: [R] bootstrap resampling - simplifi

Re: [R] bootstrap resampling - simplified

2011-03-02 Thread Giovanni Petris
But this seems to me to be equivalent to sample(rep(1:20, 5), 20), which I previously suggested and was pointed out to be wrong Giovanni On Wed, 2011-03-02 at 11:05 -0700, Vokey, John wrote: > On 2011-03-02, at 4:00 AM, r-help-requ...@r-project.org wrote: > > > Hello there, > > > > I have

Re: [R] bootstrap resampling - simplified

2011-03-02 Thread Jonathan P Daily
t; - Jubal Early, Firefly r-help-boun...@r-project.org wrote on 03/02/2011 01:05:01 PM: > [image removed] > > Re: [R] bootstrap resampling - simplified > > Vokey, John > > to: > > r-help > > 03/02/2011 01:07 PM > > Sent by: > > r-help-boun.

Re: [R] bootstrap resampling - simplified

2011-03-02 Thread Vokey, John
On 2011-03-02, at 4:00 AM, r-help-requ...@r-project.org wrote: > Hello there, > > I have a problem concerning bootstrapping in R - especially focusing on the > resampling part of it. I try to sum it up in a simplified way so that I would > not confuse anybody. > > I have a small database consi

Re: [R] bootstrap resampling question

2011-03-02 Thread Giovanni Petris
self have purpose? Or do we, what's the word... imbue it." > - Jubal Early, Firefly > > r-help-boun...@r-project.org wrote on 03/01/2011 09:37:31 AM: > > > [image removed] > > > > Re: [R] bootstrap resampling question > > > > Giovanni Petris

Re: [R] bootstrap resampling - simplified

2011-03-01 Thread Dennis Murphy
Hi: On Tue, Mar 1, 2011 at 8:22 AM, Bodnar Laszlo EB_HU < laszlo.bod...@erstebank.hu> wrote: > Hello there, > > I have a problem concerning bootstrapping in R - especially focusing on the > resampling part of it. I try to sum it up in a simplified way so that I > would not confuse anybody. > > I

Re: [R] bootstrap resampling question

2011-03-01 Thread Jonathan P Daily
4) 724-4480 "Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it." - Jubal Early, Firefly r-help-boun...@r-project.org wrote on 03/01/2011 09:37:31 AM: > [image removed] > > Re: [R] bootstrap r

Re: [R] bootstrap resampling question

2011-03-01 Thread Giovanni Petris
A simple way of sampling with replacement from 1:20, with the additional constraint that each number can be selected at most five times is > sample(rep(1:20, 5), 20) HTH, Giovanni On Tue, 2011-03-01 at 11:30 +0100, Bodnar Laszlo EB_HU wrote: > Hello there, > > I have a problem concerning bootst

Re: [R] bootstrap resampling question

2011-03-01 Thread Greg Snow
Here are a couple of thoughts. If you want to use the boot package then the statistic function you give it just receives the bootstrapped indexes, you could test the indexes for your condition of not more than 5 of each and if it fails return an NA instead of computing the statistic. Then in y

Re: [R] Bootstrap error message: Error in statistic(data, origina l, ...) : unused argument(s) ( ...) [Broadcast]

2010-11-15 Thread German
Hey everybody. I found the solution to the problem - at least for univariate statistics. In order to use the bootstrap method for an arbitrary statistic, the syntax for the function has to be in the form: Given a univariate formula with argument 'x': myfunction <- function(x,p){formula(x[p])}

Re: [R] Bootstrap confidence intervals using bootcov from the rms package

2010-11-10 Thread Kim Fernandes
Hi Frank, Good to know. Thanks again for your help! Kim On Wed, Nov 10, 2010 at 8:53 AM, Frank Harrell wrote: > > Unfortunately, bootcov is not meant to operate on fit objects produced by > fit.mult.impute. bootcov "gets there too late" in the process and does not > know how to penalize for i

Re: [R] Bootstrap confidence intervals using bootcov from the rms package

2010-11-10 Thread Frank Harrell
Unfortunately, bootcov is not meant to operate on fit objects produced by fit.mult.impute. bootcov "gets there too late" in the process and does not know how to penalize for imputation. Frank - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in contex

Re: [R] bootstrap in pROC package

2010-10-13 Thread Łukasz Ręcławowicz
Try: ci.auc(all$D,all$pre,m="b") 2010/10/13 zhu yao : > Dear useRs: > > I use pROC package to compute the bootstrap C.I. of AUC. > > The command was as follows: > > roc1<-roc(all$D,all$pre,ci=TRUE,boot.n=200) -- Miłego dnia __ R-help@r-project.org ma

Re: [R] Bootstrap

2010-08-09 Thread Shentu
You should bootstrap the two groups separately. The bootstrap sample you get do not follow the same order as the original sample, so the first 62 observations are coming from both groups. What you bootstrapped is essentially the difference between the pooled mean and itself, which would no doubt

Re: [R] Bootstrap

2010-08-08 Thread Wu Gong
Hi, I assume you used boot package. Try this: library(boot) x <- rnorm(136) fun <- function(x,ind){ x <- x[ind] m <- mean(x[63:136])-mean(x[1:62]) m } boot.x<- boot(x, fun, R = 5000, sim = "ordinary") - A R learner. -- View this message in context: http:/

Re: [R] bootstrap confidence intervals, non iid

2010-04-09 Thread Kay Cichini
hi glen, i need conf.intervals for blocked data, as described in the first place. i've learned in the meantime, that the boot() function can handle this. i had to formulate the function for the boot command, put "sites" to the strata argument and resample from each subsetted level of the fact

Re: [R] bootstrap confidence intervals, non iid

2010-04-08 Thread GlenB
It's possible I have failed to understand your situation (it's not clearly described). If your model captures the dependence structure (e.g. that induced by a common-but-unknown block effect), then in many cases it could be set up to work. If the dependence is of some form not captured in the mod

Re: [R] bootstrap confidence intervals, non iid

2010-04-06 Thread Kay Cichini
not yet, but it would either not solve the non iid problem, or would it? -- View this message in context: http://n4.nabble.com/bootstrap-confidence-intervals-non-iid-tp1751619p1752583.html Sent from the R help mailing list archive at Nabble.com. __ R

Re: [R] bootstrap confidence intervals, non iid

2010-04-06 Thread GlenB
Kay Cichini wrote: > > i need to calculate ci's for each of 4 groups within a dataset, to be able > to infere about differences in the variable "similarity". the problem is > that data within groups is dependent, as assigned by the blocking-factor > "site". my guess was to use a block bootstrap

Re: [R] bootstrap help

2010-01-06 Thread Dennis Murphy
Hi: Does this work? df <- data.frame(x = rnorm(49, mean = 1), y = rnorm(49, mean = 2)) # Generate matrix of bootstrap indices idx <- matrix(sample(1:nrow(df), 50 * nrow(df), replace = TRUE), nrow = nrow(df)) dim(idx) # [1] 49 50 # Generate the corresponding x, y, bootstrap samples by

Re: [R] bootstrap help

2010-01-06 Thread luciferyan
I have a similar question. I want to generate list of 50 bootstrap samples, it can be done by: lapply(1:50,function(i){data[sample(nrow(data),size=nrow(data),replace=TRUE),]}) >From these bootstrap samples, I want to work out the Bootstrap estimates, which is E[y]/E[x]. How can I do it? '>> da

Re: [R] bootstrap help

2009-12-07 Thread Marek Janad
If I read your question now, I think, that I didn't understand you correctly, but... My code generates 50 bootstrap samples (50 tables) and for each calculates mean of column x and mean of column y, so the final result is matrix with means. If you don't want to calculate means, code below generat

Re: [R] bootstrap help

2009-12-06 Thread casperyc
Hi there, This seems to 'simple' for that. ( I mean the codes are too good) Can I ask for a bit explaination? or some simplier (maybe few more line codes) to archieve that goal? And the codes you gave here, first line give a table with x and y , random normal values, but the second line, what d

Re: [R] bootstrap help

2009-12-06 Thread Marek Janad
data<-data.frame(x=rnorm(49), y=rnorm(49)) t(sapply(1:50,function(i){colMeans(data[sample(nrow(data),size=nrow(data),replace=TRUE),])})) r-help@r-project.org 2009/12/7 casperyc : > > Hi there, > > i think that's not what i was aiming for... > > i was aked to > > Generate 50 Bootstrap samples and

Re: [R] bootstrap help

2009-12-06 Thread casperyc
Hi there, i think that's not what i was aiming for... i was aked to Generate 50 Bootstrap samples and corresponding estimates if i do data[sample(nrow(data),size=50,replace=TRUE),] it will give me a table of 50 rows ( 50 sets of x and y) then how do i estimate the mean? ( mean was esitmated b

Re: [R] bootstrap help

2009-12-06 Thread Ben Bolker
casperyc hotmail.co.uk> writes: > I have 49 pairs in my data.frame 'data' > > x y > 7680 > ... ... > > how do I get a bootstrap sample of size n=50? > data[sample(nrow(data),size=50,replace=TRUE),] __ R-help@r-project.org mailing list http

Re: [R] Bootstrap inference for the sample median?

2009-08-31 Thread Ted Harding
On 30-Aug-09 16:24:08, Emmanuel Charpentier wrote: > Le dimanche 30 août 2009 Ã_ 18:43 +0530, Ajay Shah a écrit : >> Folks, >> I have this code fragment: >> set.seed(1001) >> x <- c(0.79211363702017, 0.940536712079832, 0.859757602692931, >> 0.82529998629531, 0.973451006822,0.9237

Re: [R] Bootstrap inference for the sample median?

2009-08-30 Thread Emmanuel Charpentier
Le dimanche 30 août 2009 à 18:43 +0530, Ajay Shah a écrit : > Folks, > > I have this code fragment: > > set.seed(1001) > x <- c(0.79211363702017, 0.940536712079832, 0.859757602692931, > 0.82529998629531, > 0.973451006822, 0.92378802164835, 0.996679563355802, > 0.9433477394

Re: [R] Bootstrap or Wilcoxons' test?

2009-02-14 Thread David Winsemius
On Feb 14, 2009, at 3:23 AM, Thomas Lumley wrote: On Fri, 13 Feb 2009, David Winsemius wrote: I must disagree with both this general characterization of the Wilcoxon test and with the specific example offered. First, we ought to spell the author's correctly and then clarify that it is th

Re: [R] Bootstrap or Wilcoxons' test?

2009-02-14 Thread Thomas Lumley
On Fri, 13 Feb 2009, David Winsemius wrote: I must disagree with both this general characterization of the Wilcoxon test and with the specific example offered. First, we ought to spell the author's correctly and then clarify that it is the Wilcoxon rank-sum test that is being considered. Next,

Re: [R] Bootstrap or Wilcoxons' test?

2009-02-13 Thread David Winsemius
link.net - Original Message - From: "David Winsemius" > To: "Murray Cooper" Cc: "Charlotta Rylander" ; Sent: Friday, February 13, 2009 9:19 PM Subject: Re: [R] Bootstrap or Wilcoxons' test? I must disagree with both this general characterization of the

Re: [R] Bootstrap or Wilcoxons' test?

2009-02-13 Thread Daniel Malter
y 13, 2009 9:19 PM An: Murray Cooper Cc: r-help@r-project.org Betreff: Re: [R] Bootstrap or Wilcoxons' test? I must disagree with both this general characterization of the Wilcoxon test and with the specific example offered. First, we ought to spell the author's correctly and then cl

Re: [R] Bootstrap or Wilcoxons' test?

2009-02-13 Thread Murray Cooper
samples. Murray M Cooper, Ph.D. Richland Statistics 9800 N 24th St Richland, MI, USA 49083 Mail: richs...@earthlink.net - Original Message - From: "David Winsemius" To: "Murray Cooper" Cc: "Charlotta Rylander" ; Sent: Friday, February 13, 2009 9:19 PM

  1   2   >