Displaying 20 results from an estimated 10000 matches similar to: "delete.response leaves response in attribute dataClasses"
2011 Apr 19
1
How to Extract Information from SIMEX Output
Below is a SIMEX object that was generated with the "simex" function from the
"simex" package applied to a logistic regression fit. From this mountain of
information I would like to extract all of the values summarized in this
line:
.. ..$ variance.jackknife: num [1:5, 1:4] 1.684 1.144 0.85 0.624 0.519 ...
Can someone suggest how to go about doing this? I can extract the
2013 Jan 29
3
how to suppress the intercept in an lm()-like formula method?
I'm trying to write a formula method for canonical correlation analysis,
that could be called similarly to lm() for
a multivariate response:
cancor(cbind(y1,y2,y3) ~ x1+x2+x3+x4, data=, ...)
or perhaps more naturally,
cancor(cbind(y1,y2,y3) ~ cbind(x1,x2,x3,x4), data=, ...)
I've adapted the code from lm() to my case, but in this situation, it
doesn't make sense to
include an
2019 Apr 05
1
subscripting a terms object
Someone sent me a bug report for survival2.44.1-1 that involves a model with both cluster
and offset.? It turns out to be a 3 part issue with [.terms and my own untangle.specials
routine.?? I've spent an evening sorting out the details.
? 1. The delete.response() function doesn't remove the response from the dataClasses
attribute, which leads to a later failure in [.terms for
2009 Apr 26
1
help with plotting results of lda
Hi,
I've performed an lda and obtained a classification table for some of my
data:
> efa.dfa<-lda(groups~.,efa.scores.8,CV=T)
> str(efa.dfa)
List of 5
$ class : Factor w/ 2 levels "1","2": 1 2 1 2 1 1 2 2 1 2 ...
$ posterior: num [1:160, 1:2] 0.99083 0.00852 0.93983 0.23186 0.85931 ...
..- attr(*, "dimnames")=List of 2
.. ..$ : chr [1:160]
2012 Jul 31
1
kernlab kpca predict
Hi!
The kernlab function kpca() mentions that new observations can be transformed by using predict. Theres also an example in the documentation, but as you can see i am getting an error there (As i do with my own data). I'm not sure whats wrong at the moment. I haven't any predict functions written by myself in the workspace either. I've tested it with using the matrix version and the
2012 Jun 11
1
saving sublist lda object with save.image()
Greetings R experts,
I'm having some difficulty recovering lda objects that I've saved within sublists using the save.image() function. I am running a script that exports a variety of different information as a list, included within that list is an lda object. I then take that list and create a list of that with all the different replications I've run. Unfortunately I've been
2012 Aug 01
2
sub setting a data frame with binomial responses
Hi everyone,
Let me have a dataframe named ?mydata? and created as below,
*> n=c(5,5,5,5) #number of trils
> x1=c(2,3,1,3) ) #number of successes
> x2=c(5,5,5,5) #number of successes
> x3=c(0,0,0,0) #number of successes
> x4=c(5,0,5,0) #number of successes
> mydata=data.frame(n,x1,x2,x3,x4)
> mydata*
n x1 x2 x3 x4
1 5 2 5 0 5
2 5 3 5 0 0
3 5 1 5 0 5
4 5 3 5 0
2008 Mar 29
1
Tabulating Sparse Contingency Table
I have a sparse contingency table (most cells are 0):
> xtabs(~.,data[,idx:(idx+4)])
, , x3 = 1, x4 = 1, x5 = 1
x2
x1 1 2 3
1 0 0 31
2 0 0 112
3 0 0 94
, , x3 = 2, x4 = 1, x5 = 1
x2
x1 1 2 3
1 0 0 0
2 0 0 0
3 0 0 0
, , x3 = 3, x4 = 1, x5 = 1
x2
x1 1 2 3
1 0 0 0
2 0 0 0
3 0 0 0
, , x3 = 1, x4
2010 Dec 14
2
How to bind models into a list of models?
Hi R-helpers,
I have a character object called dd that has 32 elements each of which
is a model formula contained within quotation marks. Here's what it
looks like:
> dd
[1] "lm(y ~ 1,data=Cement)" "lm(y ~
X,data=Cement)" "lm(y ~ X1,data=Cement)"
[4] "lm(y ~ X2,data=Cement)" "lm(y ~
2013 Apr 13
1
how to add a row vector in a dataframe
Hi,
Using S=1000
and
simdata <- replicate(S, generate(3000))
#If you want both "m1" and "m0" #here the missing values are 0
res1<-sapply(seq_len(ncol(simdata.psm1)),function(i) {x1<-merge(simdata.psm0[,i],simdata.psm1[,i],all=TRUE); x1[is.na(x1)]<-0; x1})
res1[,997:1000]
#????? [,1]???????? [,2]???????? [,3]???????? [,4]???????
#x1??? Numeric,3000 Numeric,3000
2005 Oct 05
1
Ad: Re: R crashes for large formulas in lm() (PR#8180)
Dette er en melding med flere deler i MIME-format.
--=_alternative 004613C000257091_=
Content-Type: text/plain; charset="US-ASCII"
And some more informastion I forgot.
R does not crash if I write out the formula:
set.seed(123)
x1 <- runif(1000)
x2 <- runif(1000)
x3 <- runif(1000)
x4 <- runif(1000)
x5 <- runif(1000)
x6 <- runif(1000)
x7 <- runif(1000)
x8 <-
2006 Aug 16
1
Specifying Path Model in SEM for CFA
I'm using specify.model for the sem package. I can't figure out how to
represent the residual errors for the observed variables for a CFA
model. (Once I get this working I need to add some further constraints.)
Here is what I've tried:
model.sa <- specify.model()
F1 -> X1,l11, NA
F1 -> X2,l21, NA
F1 -> X3,l31, NA
F1 -> X4,l41, NA
F1 -> X5, NA, 0.20
2003 Oct 05
3
stepAIC problem
Dear R-users
I have a probelm running stepAIC in R1.7.1
I wrote a program which used stepAIC as a part of it,
and it worked fine while I was using the previous version of
R1.7.0. However, I found the program did not work any more.
Now, R produces a message which tells
"Error in as.data.frame.default(data) :
can't coerce function into a data.frame" every time I
run the part of
2012 Jan 25
0
Last Call: Who says this is not a bug in delete.response()?
On January 5, I posted here concerning this issue
(https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14767), and I
have not heard any answers from people who think this is not a bug,
or a simple accident in the delete.response function.
The output from delete.response on a terms object alters the formula
by removing the dependent variable. It removes the response from the
"variables"
2012 Sep 12
3
how to create a substraction matrix (subtract a row of every column from the same row in other columns)
Hello
I have data like this
x1 x2 x3 x4 x5
I want to create a matrix similar to a correlation matrix, but with the
difference between the two values, like this
x1 x2 x3 x4 x5
x1 x2-x1 x3-x1 x4-x1 x5-x1
x2 x3-x2 x4-x2 x5-x2
x3 x4-x3 x5-x3
x4 x5-x4
x5
Then I
2005 Jun 07
1
Help with possible bug (assigning NA value to data.frame) ?
There's something peculiar that I do not understand here. However, did you
realize that the thing you are assigning into parts of `a' is NULL? Check
you're my.test.boot.ci.1: It's NULL.
Be that as it may, I get:
> a <- data.frame(matrix(1:4, nrow=2), X3=NA, X4=NA)
> a
X1 X2 X3 X4
1 1 3 NA NA
2 2 4 NA NA
> a[a$X1 == 1,]$X3 <- NULL
> a
X1 X2 X3 X4
1 1
2008 Aug 01
5
drop1() seems to give unexpected results compare to anova()
Dear all,
I have been trying to investigate the behaviour of different weights in
weighted regression for a dataset with lots of missing data. As a start
I simulated some data using the following:
library(MASS)
N <- 200
sigma <- matrix(c(1, .5, .5, 1), nrow = 2)
sim.set <- as.data.frame(mvrnorm(N, c(0, 0), sigma))
colnames(sim.set) <- c('x1', 'x2') # x1 & x2 are
2004 Sep 27
1
random discrete from the first tuple
Dear UseR
I have a dataset, for instance x1(A, B, C), x2(M,F), x3(X1,X2,X3,X4)
and x4(W,F,P). I want to make a small dataset with the random tuple. I
know package e1071 can handle a random discrete,
> library(e1071)
> x1 <- rdiscrete(6, c(2,2,2), c("A","B","C"))
> x2 <- rdiscrete(6, c(3,3), c("M","F"))
> x3 <-
2005 Apr 22
3
as.data.frame: Error in "names<-.default" (PR#7808)
Hello,
I found a potential problem in R 2.1.0 (and R 2.0.1)
I expect that
> tmp <- FUN(x1, x2, x3, x4)
> as.data.frame(tmp)
is the same as
> as.data.frame(FUN(x1, x2, x3, x4))
since the tmp variable in this case is unnecessary.
However, below I will demonstrate that under an odd set of conditions, I
can correctly perform as.data.frame(tmp), but not as.data.frame(FUN(x1,
x2, x3,
2007 Sep 01
2
Comparing "transform" to "with"
Hi All,
I've been successfully using the with function for analyses and the
transform function for multiple transformations. Then I thought, why not
use "with" for both? I ran into problems & couldn't figure them out from
help files or books. So I created a simplified version of what I'm
doing:
rm( list=ls() )
x1<-c(1,3,3)
x2<-c(3,2,1)
x3<-c(2,5,2)