Displaying 20 results from an estimated 2000 matches similar to: "names attribute of data.frames after rbind"
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,
2003 Jun 23
1
erase.screen bug?
Hi,
I'm using R 1.7.1 on a Windows 2K computer. For some reason erase.screen
does not seem to be working correctly. That is it does not erase the
requested screen. That is the old graphic is still visible and any
subsequent graphics are superimposed over it making them impossible to
read. What is worse is that they print out this way also. The same
behaviour happens with a Windows XP
2004 Aug 01
1
Problem with RGui and MASS
Hi,
Using R1.9.1 for Windows with Windows 2000 (also XP), I have come
across the following problem that I have not seen before and am at
a loss to explain. If I create an object using rlm from library(MASS)
and then save the workspace, I cannot reopen it using RGUI by double
clicking on the .RData file as I normally do. If I double click on
the icon, R starts and then gives the following
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 Jun 25
1
trouble using boot package
Hello,
I am trying to carry out a bootstrap analysis (using the boot package) on a
table and cannot work out how to get the results I need!
I have a table ("d2") with 4 columns: "ID_code", "Age", "Quarter" and
"StomWt". Age (0-5) and Quarter (1-4) are my strata
Therefore I wish to estimate the confidence intervals for the mean StomWt
for each Age
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)
2005 Apr 08
0
Error in save.image
Hi,
I just came across an error that I haven't seen before and hope someone
can help me. When I try to save my current workspace (using save.image
or on quitting) I get the error message
Error in save.image() : recursive default argument reference
Does anyone know what is going on and how I can quit R without losing the
contents of my current workspace?
I am running R2.0.1 on a windows
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
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
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
2007 Mar 10
3
long character string problem
Hi All
I am having 2 very long character strings (550chars) and I want to put them as
expressions together with c(). The problem is that I also get these
double-quotes, as seen below in 'fct'. How can I remove these double-quotes? I
tried as.name() but it did not work (because of size?). These are creating
trouble with subsequent programs, which I tested with strings that for some
2011 Dec 15
2
Data Manipulation - make diagonal matrix of each element of a matrix
Dear R list,
I have the following data:
set.seed(1)
n <- 5 # number of subjects
tt <- 3 # number of repeated observation per subject
numco <- 2 # number of covariates
x <- matrix(round(rnorm(n*numco),2), ncol=numco) # the actual covariates
x
> x
[,1] [,2]
[1,] -0.63 -0.82
[2,] 0.18 0.49
[3,] -0.84 0.74
[4,] 1.60 0.58
[5,] 0.33 -0.31
I need to form a matrix
2012 Nov 28
1
Help setting optimization problem to include more constraints
Dear R-helpers,
I am struggling with an optimization problem at the moment and decided to
write the list looking for some help. I will use a very small example to
explain what I would like to. Thanks in advance for your help.
We would like to distribute resources from 4 warehouses to 3 destinations.
The costs associated are as follows:
Destination
>From 1 2 3 Total
2006 Aug 25
2
horizontal direct product
II am translating some gauss code into R, and gauss has a matrix
product function called the horizontal direct product (*~), which is
some sort of variant on the Kronecker product.
For example if x is 2x2 and y is 2x2
the horizontal direct product, z, of x and y is defined (in the Gauss
manual) as:
row 1 = x11*y11 x11*y12 x12*y11 x12*y12
row 2 = x21*y21 x21*y22 x22*y21 x22*y22
Or in R
2005 Aug 15
2
queer data set
I have a dataset that is basically structureless. Its dimension varies
from row to row and sep(s) are a mixture of tab and semi colon (;) and
example is
HEADER1 HEADER2 HEADER3 HEADER3
A1 B1 C1 X11;X12;X13
A2 B2 C2 X21;X22;X23;X24;X25
A3 B3 C3
A4 B4 C4 X41;X42;X43
A5 B5 C5 X51
etc., say. Note that a blank
2011 May 01
1
Longitudinal data with non-randomized subjects
Dear List,
I have a theoretical question related to epidemiological data analysis:
If the treatment status (tx = 0,1) changes over time for the patients in a non-randomized cohort, is there a way to estimate the treatment effect?
(i.e., after joining the study, some patients may have to wait for a period of time before receiving the treatment, i.e., the situation of patient with id == 2 for the