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

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

2022-05-28 Thread varin sacha via R-help
Dear R-experts, While comparing groups, it is better to assess confidence intervals of those differences rather than comparing confidence intervals for each group. I am trying to calculate the CIs of the difference between the two Cramer's V and not the CI to the estimate of each group’s Cramer'

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

[R] bootstrap confidence intervals

2021-11-05 Thread varin sacha via R-help
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<-function(d,i) { temp<-d[i,] HodgesLehmann(A) } boot.out<-

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

[R] Bootstrap P-Value

2020-11-06 Thread AbouEl-Makarim Aboueissa
*Dear All:* *I am trying to compute the p-value of the bootstrap test; please see below.* *In example 1 the p-value agrees with the confidence interval.* *BUT, in example 2 the p-value DOES NOT agree with the confidence interval. In Example 2, the p-value should be zero or close to zero.* *I am

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

[R] bootstrap sample for clustered data

2018-09-16 Thread Liu, Lei
Hi there, I posted this message before but there may be some confusion in my previous post. So here is a clearer version: I'd like to do a bootstrap sampling for clustered data. Then I will run some complicated models (say mixed effects models) on the bootstrapped sample. Here id is the cluste

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

[R] bootstrap sample for clustered data

2018-09-16 Thread Liu, Lei
Hi there, I tried to generate bootstrap samples for clustered data. Here is some code I found in the web to do the work: id=c(1, 1, 2, 2, 3, 3, 4, 4, 5, 5) y=c(.5, .6, .4, .3, .4, 1, .9, 1, .5, 2) x=c(0, 0, 1, 1, 0, 0, 1, 1, 1, 1 ) xx=data.frame(id, x, y) boot.cluster <- function(x, id){ bo

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

[R] Bootstrap and average median squared error

2018-05-21 Thread varin sacha via R-help
Dear R-experts, I am trying to bootstrap (and average) the median squared error evaluation metric for a robust regression. I can't get it. What is going wrong ? Here is the reproducible example. # install.packages( "quantreg" ) library(quantreg) crp <-c(12,14,13,24

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]

[R] Bootstrap analysis from a conditional logistic regression

2017-11-13 Thread Nelly Reduan
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] Screenshot 2017-11-12 18.49.4

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

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

2017-08-19 Thread Aleksander Główka
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 dat

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

[R] Bootstrap using ARIMA model

2016-12-01 Thread Ashwini Patil
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(boot) library(tseries) library(TTR) library(quantmod) library(scales) librar

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

[R] Bootstrap Methods for Confidence Intervals -- glmnet

2016-05-12 Thread Lorenzo Isella
Dear All, Please have a look at the code at the end of the email. It is just an example of regression based on glmnet with some artificial data. My question is how I can evaluate the uncertainty of the prediction yhat. It looks like there are some reasons for not providing a standard error estima

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

[R] bootstrap glm

2016-02-25 Thread Hassan, Nazatulshima
Hi I have a data with an outcome,Y and 10 predictors (X1-X10). My aim is to fit a logistic model to each of the predictors and calculate the deviance difference (dDeviance). And later on bootstrapping the dDeviance for 100 times (R=100). I tried the following function. It is calculating the origi

[R] Bootstrap library

2015-07-29 Thread Amelia Marsh via R-help
Hello! I have following data and I am trying to apply bootstrapping. My data and code is as follows- amounts = c(829.53,4000,6000,1000,1063904,102400,22000,4000,4200,2000,1,400,459006,7276,4000,100,4000,1,613803.36, 3825,1000,5000,4000,3000,84500,200,2000,68000,97400,6267.8,49500,2700

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

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

2015-01-17 Thread varin sacha
Hi dear R-experts, I want to compare the bootstrap percentile interval, the Z interval, the T interval, etc.So I use a function (I have modified a few things) I have found on stats.stackexchange. simfun <- function(n=20) {x <- rnorm(n)m.x <- mean(x)s.x <- sd(x)z <- m.x/(1/sqrt(n))t <- m.x/(s.x/s

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

[R] Bootstrap CIs for weighted means of paired differences

2014-11-14 Thread ivan
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 wrong. Appreciate any help. Thanks. Here is a reproducible

[R] Bootstrap or subsampling using loop?

2013-11-25 Thread Suparna Mitra
Hello R experts, I am trying to do a job where I need to take random subsample from a data and then frequency count of that. Then the median or the frequency from say, 1000 replicates. Should I try this with subsample in loop or bootstrap? My data format is > str(Data) 'data.frame': 155752 obs.

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

[R] bootstrap from binary confidence intervals (Hmisc binconf)

2013-08-21 Thread Folkes, Michael
Hello all, I've generated a series of CI's of proportions from numerous samples using Hmisc binconf(). Now I wish to bootstrap from those values for some additional products. (ie sample to get a proportion, multiply that proportion with another number). We know it's not normally distributed. How

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

[R] Bootstrap encounter histories data

2013-03-14 Thread Simone Santoro
Hi all, I am working with a capture-recapture analyses and my data set consists of a typical set of encounter histories. Thus, for each individual I have a string (same length for all the individuals) consisting of 0 (not seen) and other numbers (seen in state "1", seen in state "2", etc. where

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
n > >> -Original Message- >> From: > r-help-bounces@ > [mailto:r-help-bounces@r- >> project.org] On Behalf Of Frank Harrell >> Sent: Tuesday, March 12, 2013 11:27 AM >> To: > r-help@ >> Subject: [R] Bootstrap BCa confidence limits

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

2013-03-12 Thread John Fox
@r- > project.org] On Behalf Of Frank Harrell > Sent: Tuesday, March 12, 2013 11:27 AM > To: r-help@r-project.org > Subject: [R] Bootstrap BCa confidence limits with your own resamples > > I like to bootstrap regression models, saving the entire set of > bootstrapped > re

[R] Bootstrap BCa confidence limits with your own resamples

2013-03-12 Thread Frank Harrell
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 cover

[R] bootstrap a multinomial regression

2012-12-10 Thread Iasonas Lamprianou
Dear friends, does anyone know how I can bootstrap a multinomial regression (say using mlogit or multinom from the nnet package) in a way similar to the one implemented bybootStepAIC?  Thanks   Dr. Iasonas Lamprianou Department of Social and Political Sciences University of Cyprus [[al

[R] Bootstrap estimates and variance

2012-12-06 Thread Nishil Chandaria
Hi Tim, I have a question and was wondering if you could help me solve it. I have a set of paired data, and have generated 50 bootstrap samples on this in R. However, I am struggling to find codes to find the corresponding estimates, and an estimate for the variance of theta-hat. Any help would

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

[R] bootstrap based confidence band

2012-12-05 Thread Rebecca
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) summary(fit)   I define a bootstrap function named PairedBootstrap which is not listed here. Than I t

[R] bootstrap lmekin model

2012-11-24 Thread Roberta Carriero
Hi,I use the 'lmekin' model of the 'kinship' package of R in order to estimate heritability. I want to estimate the confidence interval of the variance coefficient and so I should use a bootstrap simulation. The pedigree file has 1386 subjects so I create a kinship matrix [1386*1386].This is th

[R] Bootstrap lmekin model

2012-11-24 Thread Roberta Carriero
Hi,I use the 'lmekin' model of the 'kinship' package of R in order to estimate heritability. I want to estimate the confidence interval of the variance coefficient and so I should use a bootstrap simulation. The pedigree file has 1386 subjects so I create a kinship matrix [1386*1386].This is th

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

[R] bootstrap in time dependent Cox model‏

2012-02-20 Thread Ehsan Karim
Dear R-list, I am wondering how to perform a bootstrap in R for the weighted time dependent Cox model‏ (Andersen–Gill format, with multiple observations from each patients) to obtain the bootstrap standard error of the treatment effect. Below is an example dataset. Would 'censboot' be appropriate

[R] Bootstrap values for hierarchical tree based on distaance matrix

2011-11-15 Thread ronny
I would like to get an hierarchical clustering tree with bootstrap values indicated on the nodes, as in pvclust. The problem is that I have only distance matrix instead of the raw data, required for pvclust. Is there a way to get it? fit1 <- hclust(dist) # an object of class '"dist" plot(fit1) # d

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

[R] bootstrap means by strata

2011-10-13 Thread Tim Howard
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 grouping variable. I was thinking the boot package would be the thing to use, but now I'm not so sure ... given the discussion here: http://finzi.psych.upenn.edu/Rhel

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

[R] bootstrap function

2011-09-06 Thread shu chen
Hi, all, When I ran the following code, library (Design) reri <- function(datsam) { fitlr <- glm(PTSDpy ~ toxo*PTE, family=binomial, data=datsam) reri <- exp(fitlr$coef[2]+fitlr$coef[3]+fitlr$coef[4])-exp(fitlr$coef[2]) - exp(fitlr$coef[3]) + 1 } summary.bootstrap(bootstrap(PTE.work, reri(PTE

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

[R] Bootstrap

2011-07-20 Thread Val
Hi all, I am facing difficulty on how to use bootstrap sampling and below is my example of function. Read a data , use some functions and use iteration to find the solution( ie, convergence is reached). I want to use bootstrap approach to do it several times (200 or 300 times) this whole proce

[R] Bootstrap or Wilks ?

2011-06-04 Thread thibault.charles
Dear R-users, The following question is more a statistic question than a R issue. I would like to know the difference between the two following non parametric technics : the bootstrap and the Wilks formula. I understand well the theory about the two technics but cannot find anything about their

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

[R] bootstrap vignette construction and package installation

2011-05-03 Thread Murat Tasan
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(MyPackage) now, when trying to build a .tar.gz ins

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

[R] Bootstrap 95% confidence intervals for splines

2011-03-26 Thread mitchell wachtel
There appear to be reports in the literature that transform continuous independent variablea by the use of splines, e.g., assume the dependent variable is hot dogs eaten per week (HD) and the independent variable is waistline (WL), a normal linear regression model would be: nonconfusing_regressio

[R] Bootstrap memory use?

2011-03-16 Thread Matthew Vernon
Hi, the boot function from the "boot" library seems to use an implausible quantity of memory; is this to be expected, or am I doing something wrong? Specifically, the vector I wish to bootstrap off is about 17000 entries long length(fes) [1] 16988 bm <- function(x,indexes) mean(x[indexes]) then

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

[R] bootstrap

2011-03-06 Thread Ashish Kumar
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 991.39 36.78807 110.0254 Now if I want est

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

  1   2   >