similar to: bootstrap

Displaying 20 results from an estimated 10000 matches similar to: "bootstrap"

2013 Jul 08
2
Segmentar archivos en R (Antonio José Sáez Castillo)
Estimado Mauricio Monsalvo Le paso una idea, no es un código muy lindo que digamos, pero al correrlo seguramente se dará cuenta de mi sugerencia. datos<-c(2,3,4,5,6,7,8) quantile(datos) quantile(datos,probs = c(0.25, 0.75, 0.85, 0.90, 0.95)) as.matrix(quantile(datos,probs = c(0.25, 0.75, 0.85, 0.90, 0.95))) as.data.frame(quantile(datos,probs = c(0.25, 0.75, 0.85, 0.90, 0.95))) # ¿ y si solo
2013 Jul 08
1
Segmentar archivos en R (Antonio José Sáez Castillo)
Habría que buscar la vuelta, yo no lo se, pero posiblemente lo siguiente da una pista. Nota: al mismo código le sume una línea al final datos<-c(2,3,4,5,6,7,8) quantile(datos) quantile(datos,probs = c(0.25, 0.75, 0.85, 0.90, 0.95)) as.matrix(quantile(datos,probs = c(0.25, 0.75, 0.85, 0.90, 0.95))) as.data.frame(quantile(datos,probs = c(0.25, 0.75, 0.85, 0.90, 0.95))) # ¿ y si solo solicita
2011 Nov 30
3
Segmentar archivos en R (Antonio José Sáez Castillo)
Hola Leonardo. Creo que te refieres a analizar alguna variable por grupos. Eso te lo pueden hacer las funciones tipo tapply(). Por ejemplo, tapply(datos,factor,mean, na.rm=TRUE) tapply(datos,factor,sd, na.rm=TRUE) tapply(datos,factor,quantile,probs=c(0.05,0.95),na.rm=TRUE) En cuanto a RCommander, que lo preguntabas después, algunas opciones del menú tienen la opción "Analizar por
2008 Aug 02
1
Memory Problems with a Simple Bootstrap - Part II
I have distilled my bootstrap problem down to this bit of code, which calculates an estimate of the 95th percentile of 7500 random numbers drawn from a standard normal distribution: library(boot) per95 <- function( annual.data, b.index) { sample.data <- annual.data[b.index] return(quantile(sample.data,probs=c(0.95))) } m <- 10000 x <- rnorm(7500,0,1) B <-
2011 May 10
1
Filtering out bad data points
Hi, I always have a question about how to do this best in R. I have a data frame and a set of criteria to filter points out. My procedure is to always locate indices of those points, check if index vector length is greater than 0 or not and then remove them. Meaning dftest <- data.frame(x=rnorm(100),y=rnorm(100)); qtile <- quantile(dftest$x,probs=c(0.05,0.95)); badIdx <- which((dftest$x
2012 Nov 19
5
help on matrix column removal based on another matrix results
Hi everyone, now I am trying to finish writing the code (I had asked for assistance on subtracting arrays) This is what I what I am running in R: > source("/home/ie/Documents/TTU/GA_Research/GLUE/R-Project/R_GLUE_Example/NSEr.R") NSEr <- function (obs, sim) { {jjh <- (as.vector(obs) - sim)^2 Xjjhs <- apply(Xjjh, 2, sum) Yii <- (obs - mean(obs))^2 Yiis <- apply(Yii, 2,
2007 Oct 10
5
chi2
Hello, I want to use the quantile function so I read the doc but I don't understand with this > qchisq(seq(0.05,0.95,by=0.05),df=(length(don)-1)) [1] 62667.11 62795.62 62882.42 62951.47 63010.74 63064.00 63113.39 63160.27 63205.65 63250.33 63295.04 63340.48 63387.48 63437.03 63490.53 63550.14 63619.68 [18] 63707.24 63837.16 Can you help me please?
2012 May 28
2
R quantreg anova: How to change summary se-type
He folks=) I want to check whether a coefficient has an impact on a quantile regression (by applying the sup-wald test for a given quantile range [0.05,0.95]. Therefore I am doing the following calculations: a=0; for (i in 5:95/100){ fitrestricted=rq(Y~X1+X2,tau=i) tifunrestrited=rq(Y~X1+X2+X3,tau=i) a[i]=anova(fitrestricted,fitunrestricted)$table$Tn) #gives the Test-Value } supW=max(a) As anova
2011 Sep 25
2
Increase space between xlab and X axis tick labels
People, I am using the "las=2" parameter to rotate the labels for the X axis ticks but it means that they are almost touching the "xlab" string. I have been messing around with the "mai" paremeter but that doesn't help - is there some way of increasing the space between xlab and the X axis tick labels? Thanks, Phil. -- Philip Rhoades GPO Box 3411 Sydney
2010 Mar 28
3
Ellipse that Contains 95% of the Observed Data
I can take the results of a simulation with one random variable and generate an empirical interval that contains 95% of the observations, e.g., x <- rnorm(10000) quantile(x,probs=c(0.025,0.975)) Is there an R function that can take the results from two random variables and generate an empirical ellipse that contains 95% of the observations, e.g., x <- rnorm(10000) y <- rnorm(10000) ?
2017 Dec 07
1
Seeking help with code
Assuming the days of raining during half a year of all states(provinces) of a country is normally distributed (mean=?, standard deviation=?) with sigma (?) equals to 2. We now have 10 data points here: 26.64, 30.65, 31.27, 33.04, 32.56, 29.10, 28.96, 26.44, 27.76, 32.27. Try to get the 95% level of CI for ?, using parametric Bootstrap method with bootstrap size B=8000. my code - what am i doing
2005 Sep 08
5
data manipulation
Dear All, I would be grateful if you can help me. My problem is the following: I have a data set like: ID time X1 X2 1 1 x111 x211 1 2 x112 x212 2 1 x121 x221 2 2 x122 x222 2 3 x123 x223 where X1 and X2 are 2 covariates and "time" is the time of observation and ID indicates the
2008 Oct 03
2
Question about quantile.default
Hi all, I am running into a snag using quantile function in stats. Basically, I don't understand why the loop below throws the error that it does. test.data <- rnorm(1000, 0, 1) for (i in seq(0.00001, 0.001, 0.00001)){ test <- quantile(test.data, probs=seq(0,1,i)); print(i); } It runs fine from 1e-05 to 0.00024, but then throws the error Error in quantile.default(test.data,
2017 Jun 15
2
"reverse" quantile function
David, thanks for the response. In your response the quantile function (if I see correctly) runs on the columns versus I need to run it on the rows, which is an easy fix, but that is not exactly what I had in mind... essentially we can remove t() from my original code to make "res" look like this: res<-apply(z, 1, quantile, probs=c(0.3)) but after all maybe I did not explain
2004 Aug 31
4
More efficient matrix computation
I have a 20x3 matrix as follows: > m <- replicate(3, matrix(rnorm(20),20,1)) I need to compute, say, 95th and 99th percentiles of each column such that the resulting matrix becomes 2x3 with each row representing the respective percentile. My "best effort" is to compute one column at a time as follows: > quantile(m[,1], c(0.95, 0.99)) To do the same for columns 2 and 3, I
2011 Jun 08
1
using stimulate(model) for parametric bootstrapping in lmer repeatabilities
Hi all, I am currently doing a consistency analysis using an lmer model and trying to use parametric bootstrapping for the confidence intervals. My model is like this: model<-lmer(y~A+B+(1|C/D)+(1|E),binomial) where E is the individual level for consistency analysis, A-D are other fixed and random effects that I have to control for. Following Nakagawa and Scheilzeth I can work out the
2010 May 17
3
applying quantile to a list using values of another object as probs
Hi r-users, I have a matrix B and a list of 3x3 matrices (mylist). I want to calculate the quantiles in the list using each of the value of B as probabilities. The codes I wrote are: B <- matrix (runif(12, 0, 1), 3, 4) mylist <- lapply(mylist, function(x) {matrix (rnorm(9), 3, 3)}) for (i in 1:length(B)) { quant <- lapply (mylist, quantile, probs=B[i]) } But quant
2012 Jan 19
1
snow - bootstrapped correlation ranking
I wonder if someone could help me adjusting the following code to parallelized snow code: #Creating a data set (not needed to be parallel) n<-100 p<-100 x<-matrix(rnorm(n*p),p) y<-rnorm(n) # Bootstrapping nboot<-1000 alpha<-0.05 rhoboot <- array(0, dim=c(p,nboot)) bootranks <- array(0, dim=c(p,nboot)) bootsamples <- array( floor(runif(n*nboot)*n+1), dim=c(n,nboot)) for
2011 Feb 28
1
Robust variance estimation with rq (failure of the bootstrap?)
I am fitting quantile regression models using data collected from a sample of 124 patients. When modeling cross-sectional associations, I have noticed that nonparametric bootstrap estimates of the variances of parameter estimates are much greater in magnitude than the empirical Huber estimates derived using summary.rq's "nid" option. The outcome variable is severely skewed, and I am
2005 Nov 10
3
Remove levels
Daer All, I have a factor variable, X with 5 levels. When I type tables(X) it gives me: table(X) 1 2 3 4 5 10 5 0 0 0 How to drop the levels with zeros such that when I will type: table(X) it will give me: table(X) 1 2 10 5 Thank a lot, Bernard --------------------------------- [[alternative HTML version deleted]]