similar to: Bootstrap and average median squared error

Displaying 20 results from an estimated 1000 matches similar to: "Bootstrap and average median squared error"

2018 May 22
0
Bootstrap and average median squared error
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 <- predict(fit) y <- d$crp median(y - ypred)^2 } dat <-
2018 May 22
2
Bootstrap and average median squared error
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 it. > > > library(boot) > > bootMedianSE <- function(data,
2018 May 22
1
Bootstrap and average median squared error
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 Barradas On 5/22/2018 11:32 AM, Daniel Nordlund wrote: > On 5/22/2018
2018 May 22
0
Bootstrap and average median squared error
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", shouldn't the final line of the
2012 Nov 19
9
Stepwise analysis with fixed variables
Hello, How can I run a backward stepwise regression with part of the variables fixed, while the others participate in the backward stepwise analysis? Thank you, Einat -- View this message in context: http://r.789695.n4.nabble.com/Stepwise-analysis-with-fixed-variables-tp4650015.html Sent from the R help mailing list archive at Nabble.com.
2010 May 13
1
What's data() for?
Hi there, >library(faraway) >pima pregnant glucose diastolic triceps insulin bmi diabetes age test 1 6 148 72 35 0 33.6 0.627 50 1 2 1 85 66 29 0 26.6 0.351 31 0 >data(pima) >pima pregnant glucose diastolic triceps insulin bmi diabetes age test 1 6 148 72 35 0 33.6
2018 May 08
4
Average of results coming from B=100 repetitions (looping)
Dear R-experts, Here below the reproducible example. I am trying to get the average of the 100 results coming from the "lst" function. I have tried lst$mean and mean(lst). It does not work. Any help would be highly appreciated. #################### ?## R script for getting MedAe and MedAeSQ from HBR model on Testing data install.packages("robustbase") install.packages(
2018 Apr 25
0
Zero errors : Bug in my R code ?
Dear R-experts, I guess I have a problem with my fast function (fast tau estimator) here below. Indeed, zero errors look highly suspicious. I guess there is a bug in my R code. How could I correct my R code ? # install.packages( "robustbase" ) # install.packages( "MASS" ) # install.packages( "quantreg" ) # install.packages( "RobPer" ) #
2018 May 08
0
Average of results coming from B=100 repetitions (looping)
On 5/8/2018 12:26 PM, varin sacha via R-help wrote: > > Dear R-experts, > > Here below the reproducible example. I am trying to get the average of the 100 results coming from the "lst" function. I have tried lst$mean and mean(lst). It does not work. > Any help would be highly appreciated > > #################### > > ?## R script for getting MedAe and
2010 Jul 05
1
Linux-Windows problem
Dear All, I faced the following problem. With the same data.frame the results are different under Linux and Windows. Could you help on this topic? Thanks in advance, Ildiko Linux: > d = read.csv("CRP.csv") > d$drugCode = as.numeric(d$drug) > cor(d, use="pairwise.complete.obs") PATIENT BL.CRP X24HR.CRP X48HR.CRP drug drugCode PATIENT NA
2010 Jan 03
2
plot question
Hi, I am new to R so forgive me if the following query is somewhat simple.  I have a small tab-separated file with n records of glucose values, one record per day, seven measurements per day. It looks like this: date    sober    no    vm    nm    va    na    vs 20091229    NA    6.8    NA    2.7    11.7    2.7    6.2 I'd like to make a graph on which the glucose day curves are plotted
2013 Jan 07
3
renumber a list of numbers
Greetings R users, I am trying to renumber my groups within the file shown below. The groups are currently set as 8,9,10,etc. I would like to renumber this as 1,2,3,etc. I have searched the help files and only come across using the rownames to renumber the values but I need to match values. Any assistance is always appreciated, Regards, Charles structure(list(Group = structure(c(1L, 1L, 1L,
2010 Jul 20
1
p-values pvclust maximum distance measure
Hi, I am new to clustering and was wondering why pvclust using "maximum" as distance measure nearly always results in p-values above 95%. I wrote an example programme which demonstrates this effect. I uploaded a PDF showing the results Here is the code which produces the PDF file: ------------------------------------------------------------------------------------- s <-
2003 Sep 26
3
Std. errors of intercept and slope
Dear all, I have the following output generated by linear regression. Since there is only one regression intercept and one slope for one set of data, what is the meaning of std. error for intercept and that of slope? Thanks in advance. Sincerely, Minghua > data(thuesen) > attach(thuesen) > lm(short.velocity~blood.glucose) Call: lm(formula = short.velocity ~ blood.glucose)
2011 Sep 23
1
Adding weights to optim
I realize this may be more of a math question. I have the following optim: optim(c(0.0,1.0),logis.op,x=d1_all$SOA,y=as.numeric(md1[,i])) which uses the following function: logis.op <- function(p,x,y) { ypred <- 1.0 / (1.0 + exp((p[1] - x) / p[2])); res <- sum((y-ypred)^2) return(res) } I would like to add weights to the optim. Do I have to alter the logis.op function by
2007 Nov 01
1
loops & sampling
Hi, I'm new to R (and statistics) and my boss has thrown me in the deep-end with the following task: We want to evaluate the impact that sampling size has on our ability to create a robust model, or evaluate how robust the model is to sample size for the purpose of cross-validation i.e. in our current project we have collected a series of independent data at 250 locations, from which
2007 Nov 14
2
Help with Bartlett's test on linear model
Hi all, I would like to test the homoegeneity of variances between several linear model for some analysis of covariance. It seems that the Bartlett's test is a good test to use but I am having problem using with linear model and I cannot find any examples on the internet. There are some examples for comparisons of variances but not linear models. If I take the hellung data set, which is
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
2008 Nov 26
1
Smoothed 3D plots
DeaR list, I'm trying to represent some information via 3D plots. My data and session info are at the end of this message. So far, I have tried scatterplot3d (scatterplot3d), persp3d (rgl), persp (graphics) and scatter3d (Rmcdr) but any of them gave me what I'd like to have as final result (please see [1] for a similar 3D plot changing PF by ypred, pdn by h4 and pup by h11). In general
2011 Apr 03
2
:HELP
Hello, &nbsp; I want to sum first three terms of each column of matrix. But I don't calculate with "apply" function. &nbsp; skwkrt&lt;-function(N=10000,mu=0,sigma=1,n=100, nboot=1000,alpha=0.05){ x&lt;-rnorm(N,mu,sigma)#population samplex&lt;-matrix(sample(x,n*nboot,replace=T),nrow=nboot) #... } &nbsp; is that: suppose a is a 5x2 matrix. &nbsp;a={1,2,3,4,5