similar to: trouble using boot package

Displaying 20 results from an estimated 1300 matches similar to: "trouble using boot package"

2004 Jul 26
1
group definition for a bootstrap
Hi, This is probably really simple, but I am clearly not R-minded, I have read the help files, and reread them, and I still can't work out what to do... I have a data frame (d) with 3 columns (age (0-5), quarter (1-4) and x). I want to estimate the precision of my mean x by age and quarter, so I want to carry out a bootstrap for each group. I am trying to do this within a loop, so I don't
2004 Aug 19
5
column names in data.frame
Dear R-help, Please can someone explain how to put a column name on an output data.frame. ##Starting with a data.frame with 3 columns (d$Year, d$NoIndiv, d$wtd_tl) yr_ind <- split (d$NoIndiv, d$Year) yr_tl <- split (d$wtd_tl, d$Year) ann_ind <- sapply (yr_ind, sum) ann_tl <- sapply (yr_tl, sum) av_tl <- ann_tl/ann_ind d2<- data.frame (av_tl) ##This gives me a data.frame
2004 Aug 26
2
labels on secondary y axis
Hi, I have plotted a graph and used a secondary axis as follows: plot (d$Year, d$HrFishing, type='l', col='1', xlab='Year', ylab='Effort (hours/fishing)') par(new=TRUE) plot (d$Year, d$Landings, type='l', col='3', xlab='', ylab='') axis(4) However, if I put a label in the 2nd ylab='' it is placed over the 1st ylab, on the
2003 Oct 15
3
Strange scope problem
Hi, I have come across the following problem which seems to be a scoping issue but I'm at a loss to see why this is so or to find a good workaround. Suppose I have a function to get a prediction after model selection using the step function. step.pred <- function(dat, x0) { fit.model <- step(lm(y~., data=dat), trace=F) predict(fit.model, x0, se.fit=T) } This function works
2003 Oct 31
2
Summing elements in a list
Hi, Suppose that I have a list where each component is a list of two matrices. I also have a vector of weights. How can I collapse my list of lists into a single list of two matrices where each matrix in the result is the weighted sum of the corresponding matrices. I could use a loop but this is a nested calculation so I was hoping there is a more efficient way to do this. To help clarify,
2004 Apr 26
1
names attribute of data.frames after rbind
Hi, If columns of a data.frame have a names attribute and we rbind two similar data.frames together, the names of the column of the resulting data.frame only has the correct values for the first component and has "" in all other positions. Is this a documented "feature" or a bug? If it is intentional, why? Here is a small example to show what I mean. The same behaviour
2012 Mar 05
2
632 estimator using boot package
Dear All, Anyone has some idea how to implement 632 estimator and leave-one out bootstraping method by using boot package. I know the bootstrap package has this function, but it sounds not very flexible for my project. Thanks, Jim
2004 Mar 22
1
beginners question - kmeans
I am a complete beginner at R and am using the "kmeans" function for the first time... I have a data frame (dat) that is 17 columns * 91 rows (including headers) I have entered the following: cl <- kmeans(dat, 3, 10) plot(dat, col = cl$cluster) points(cl$centers, col = 1:2, pch = 8) the output is 17*17 graphs ... this is not what I was anticipating - I was hoping to get one graph
2005 Dec 20
2
boot problem
Hello, This is the code that is giving me problems >library(boot) >data<-read.table("test",header=FALSE,sep="\t",row.names=1) >data V2 V3 V4 A 5 8 9 B 12 54 89 C 65 89 23 D 32 69 44 E 21 84 97 F 33 59 71 G 16 45 93 H 2 46 55 I 22 33 88 >resample <- function(x,index) { sample(data,replace=TRUE) } dist<-boot(data,resample,R=1000)
2002 Aug 05
2
No subject
Hello, I downloaded R today because I was told it has very good bootstrapping abilities. What I need to do is to program it (or use an existing program) to bootstrapping test for multimodality using nonparametric kernel density estimates as proposed by Efron and Tibshirani (1993). If anyone can get me started, I will be immensely grateful. Thanks. Sangeeta
2005 Feb 23
3
bias of a boot statistic
Question: How can I get access to the bias value of a boot statistic? Details: Boot function: boot(data, statistic, R, sim="ordinary", stype="i", strata=rep(1,n), L=NULL, m=0, weights=NULL, ran.gen=function(d, p) d, mle=NULL, ...) When I create an object, containing the bootstrap statistic (object <- boot (....))I can call it and will get an output
2004 Apr 01
5
boot question
What in the world am I missing?? > x<-rnorm(20) > mean(x) [1] -0.2272851 > results<-boot(x,mean,R=5) > results[2] $t [,1] [1,] -0.2294562 [2,] -0.2294562 [3,] -0.2294562 [4,] -0.2294562 [5,] -0.2294562 Jeff Morris Ortho-Clinical Diagnostics A Johnson & Johnson Co. Rochester, NY Tel: (585) 453-5794 [[alternative HTML version deleted]]
2004 Sep 21
1
Problems with boot and optim
I am trying to bootstrap the parameters for a model that is estimated through the optim() function and find that when I make the call to boot, it runs but returns the exact same estimate for all of the bootstrap estimates. I managed to replicate the same problem using a glm() model but was able to fix it when I made a call to the variables as data frame by their exact names. But no matter how I
2005 Jun 02
2
confusion with boot
I think I am doing something wrong when I try to bootstrap R square obtained from lm. My code is included below. No matter how many times I run the simulation, I always get exactly the same result, the bias and std.error are always zero. I would think that these values should be non-zero. I would appreciate any suggestions as to what I am doing wrong, or perhaps what I fail to understand. R 2.1.0
2004 Dec 05
3
boot package
Hi, I using the boot package 1.2-20 on R 2.0.1. My statistics function estimates 6 parameters. In a small percentage of resampled data sets my statistics function doesn't produce an estimate for one parameter and the boot function stops with an error. I can write an ifelse(exists('parameter.estimate'), parameter.estimate, NA) statement within the statistic function to substitute
2000 Mar 21
3
loading data in packages
Hi, I'm new to R and have a question which seems like it should be easy. I loaded the R port of my boot library and installed it. All of the functions and help files are available but I can't seem to access the data. The data directory was created and contains files with the extension .rda. I tried to use the data() function but I get > data(city) Error: restore file corrupted -- no
2000 Apr 10
2
Increasing memory size in ESS
I am having a problem using ESS with R. In particular I have large data objects which exceed the 6Mb default heap memory. Outside of ESS I can run R by specifying large values of --vsize and --nsize but I can't figure out how to do this in ESS. Any help would be much appreciated. -- **************************************************** ** Angelo J. Canty **
2008 Jan 25
2
Help Me to Adjust the R Code
Hi, The following code, from Angelo Canty article on line "Resampling Methods in R: the boot Package, 2002", works fine for Angelo Canty using R 2.6.0 on Windows XP. It also works for me using R 1.2.1 and S-PLUS 2000 on Windows XP after installing the S-PLUS bootstrap library, with slight differences in my outputs. > library(boot) > library(survival) >
2008 Jan 26
1
(no subject)
Hi, The following code, from Angelo Canty article on line "Resampling Methods in R: the boot Package, 2002", works fine for Angelo Canty using R 2.6.0 on Windows XP. It also works for me using R 1.2.1 and S-PLUS 2000 on Windows XP after installing the S-PLUS bootstrap library, with slight differences in my outputs. > library(boot) >
2000 Jun 02
3
graphical parameters in plot
I'm using plot to make a simple plot but I want to control where the tick marks go on bot axes. The graphical parameters xaxp and yaxp seem to be ignored by the plot function so I tried setting them using op <- par(no.readonly=T) par(xaxp=c(-2.4,-2.2,5), yaxp=c(-2500,10000,6)) plot(...) par(op) but they are still ignored. Next I tried to use the axis function as follows op <-