statistics-bootstrap

R: Bootstrapped binary mixed-model logistic regression using bootMer() of the new lme4 package

╄→гoц情女王★ 提交于 2019-12-03 03:57:19
I want to use the new bootMer() feature of the new lme4 package (the developer version currently). I am new to R and don't know which function should I write for its FUN argument. It says it needs a numerical vector, but I have no idea what that function will perform. So I have a mixed-model formula which is cast to the bootMer(), and have a number of replicates. So I don't know what that external function does? Is it supposed to be a template for bootstrapping methods? Aren't bootstrapping methods already implemented in he bootMer? So why they need an external "statistic of interest"? And

Bootstrapped correlation in R

◇◆丶佛笑我妖孽 提交于 2019-12-02 15:05:28
问题 I am trying to do a bootstrapped correlation in R. I have two variables Var1 and Var2 and I want to get the bootstrapped p.value of the Pearson correlation. my variables look like this: x y 1 .6080522 1.707642 2 1.4307273 1.772616 3 0.8226198 1.768537 4 1.7714221 1.265276 5 1.5986213 1.855719 6 1.0000000 1.606106 7 1.1678940 1.671457 8 0.6630012 1.608428 9 1.0842423 1.670619 10 0.5592512 1.107783 11 1.6442616 1.492832 12 0.8326965 1.643923 13 1.1696954 1.763181 14 0.7484543 1.762921 15 1

fast function for generating bootstrap samples in matrix forms in R

三世轮回 提交于 2019-12-02 03:54:47
问题 I have a matrix A , and I would like to draw samples from each column of A and construct new matrices. For example: A = matrix(seq(1,9),3,3) so to get the 1st bootstrap matrix, I would sample with replacement (3 times) from the first column of A , i.e. 1,2,3, sample with replacement (3 times) from the second column of A , i.e. 4,5,6, and sample with replacement (3 times) from the third column of A , i.e. 7,8,9. After that, I re-construct the 1st bootstrap matrix B1 by combining the three

fast function for generating bootstrap samples in matrix forms in R

柔情痞子 提交于 2019-12-02 00:29:13
I have a matrix A , and I would like to draw samples from each column of A and construct new matrices. For example: A = matrix(seq(1,9),3,3) so to get the 1st bootstrap matrix, I would sample with replacement (3 times) from the first column of A , i.e. 1,2,3, sample with replacement (3 times) from the second column of A , i.e. 4,5,6, and sample with replacement (3 times) from the third column of A , i.e. 7,8,9. After that, I re-construct the 1st bootstrap matrix B1 by combining the three bootstrap vectors. I will repeat this procedure for B=199 times, so that bootstrap matrices B1,...,B199

Repeat the re-sampling function for 1000 times ? Using lapply?

≯℡__Kan透↙ 提交于 2019-12-01 00:17:13
问题 Please me out! I appreciate any helps ! Thanks! I have trouble on repeat doing re-sampling for 1000 times. I tried using replicate() to do that but it's not working. Is there any other method to do that? Can anyone show me if this maybe done by using lapply? Following is my code: #sampling 1000 betas0 & 1 (coefficients) from the data get.beta=function(data,indices){ data=data[indices,] #let boot to select sample lm.out=lm(y ~ x,data=data) return(lm.out$coefficients) } n=nrow(data) get.beta

Big data read subsamples R

老子叫甜甜 提交于 2019-11-30 15:29:48
I'm most grateful for your time to read this. I have a uber size 30GB file of 6 million records and 3000 (mostly categorical data) columns in csv format. I want to bootstrap subsamples for multinomial regression, but it's proving difficult even with my 64GB RAM in my machine and twice that swap file , the process becomes super slow and halts. I'm thinking about generating subsample indicies in R and feeding them into a system command using sed or awk, but don't know how to do this. If someone knew of a clean way to do this using just R commands, I would be really grateful. One problem is that

Big data read subsamples R

两盒软妹~` 提交于 2019-11-29 21:14:44
问题 I'm most grateful for your time to read this. I have a uber size 30GB file of 6 million records and 3000 (mostly categorical data) columns in csv format. I want to bootstrap subsamples for multinomial regression, but it's proving difficult even with my 64GB RAM in my machine and twice that swap file , the process becomes super slow and halts. I'm thinking about generating subsample indicies in R and feeding them into a system command using sed or awk, but don't know how to do this. If someone

Block bootstrap from subject list

一个人想着一个人 提交于 2019-11-29 13:16:30
I'm trying to efficiently implement a block bootstrap technique to get the distribution of regression coefficients. The main outline is as follows. I have a panel data set, and say firm and year are the indices. For each iteration of the bootstrap, I wish to sample n subjects with replacement. From this sample, I need to construct a new data frame that is an rbind() stack of all the observations for each sampled subject, run the regression, and pull out the coefficients. Repeat for a bunch of iterations, say 100. Each firm can potentially be selected multiple times, so I need to include it

Block bootstrap from subject list

这一生的挚爱 提交于 2019-11-28 07:13:47
问题 I'm trying to efficiently implement a block bootstrap technique to get the distribution of regression coefficients. The main outline is as follows. I have a panel data set, and say firm and year are the indices. For each iteration of the bootstrap, I wish to sample n subjects with replacement. From this sample, I need to construct a new data frame that is an rbind() stack of all the observations for each sampled subject, run the regression, and pull out the coefficients. Repeat for a bunch of