Displaying 20 results from an estimated 9000 matches similar to: "mlm for within subject design"
2010 Aug 23
3
extracting p-values from Anova objects (from the car library)
Dear all,
is there anyone who can help me extracting p-values from an Anova object
from the car library? I can't seem to locate the p-values using
str(result) or str(summary(result)) in the example below
> A <- factor( rep(1:2,each=3) )
> B <- factor( rep(1:3,times=2) )
> idata <- data.frame(A,B)
> fit <- lm( cbind(a1_b1,a1_b2,a1_b3,a2_b1,a2_b2,a2_b3) ? sex,
2012 May 04
1
Generate strings from multiple variables
Hi,
it is easiest to explain what I want to do by an example:
lets assume there are two factors/variables:
A <- c(1,2,3)
B <- c(1,3,3)
Now I would like to generate a list of strings that should look like
("A1_B1","A1_B2","A2_B1","A2_B2"). So actually the string
contains all possible combinations of A and B (separated by _). This should
be also
2008 Nov 03
0
NaN causes "error in fitter" with cph.calibrate from pkg Design
I have been attempting to use cph models to get better calibration
of my models for which I had originally used logistic regression. I
tried running with 40 repetitions and got an error. I then tried 500
repetitions (thinking that the NaNs in the output below might be
caused by that choice) and then let my computer crunch for several
hours and got only the same error message and
2010 Jul 27
0
AIC from coxme
Hi,
I am running the following model:
fit1.full <- coxme(Surv(age_sym1, sym1) ~ sex + lifedxm*sex + (1|famid),
data=bip.surv)
I would like to extract the AIC from that object to calculate the AICC.
However, when I look at str(fit1.full) and summary(fit1.full) (pasted
below) I don't see anything that would allow me to get pull the AIC out
from that object.
Is there a way to retrieve the
2012 Nov 26
1
A problem subsetting a data frame
Hi all,
I have this microarray large microarray data set (ALL) from which I would like to subset or extract a set of data based on a factor ($mol.biol). I looked up some example of subsetting in, picked up two commands and tried both but I got error messages as follows
> testset <- subset(ALL, ALL$mol.biol %in% c("BCR/ABL","ALL1/AF4"))
>> Error in
2010 Mar 01
0
MASS::loglm - exploring a collection of models with add1, drop1
I'd like to fit and explore a collection of hierarchical loglinear
models that might
range from the independence model,
~ 1 + 2 + 3 + 4
to the saturated model,
~ 1 * 2 * 3 * 4
I can use add1 starting with a baseline model or drop1 starting with the
saturated model,
but I can't see how to get the model formulas or terms in each model as
a *list* that I can work with
further.
Consider
2008 Jun 24
2
subscripting in data frames with NA
Dear list:
Given
> str(b3)
'data.frame': 159 obs. of 6 variables:
$ index_pollution : num 8.228 10.513 0.549 0.915 10.416 ...
$ position_descrip: chr "2" "2" "2" NA ...
$ position_geo : chr "3" "0" "3" "3" ...
$ institution : Factor w/ 3 levels "digesa","mem",..: 3 3 3 3 3 3
2004 Dec 01
0
gnls(0 error: invalid variable type
Dear R-helpers;
While using gnls() to fit a function
> Gbht0t.gnls <- gnls(h2 ~ Rht(b0, b1, b2, h1,t1, t2), data=gbht10,
+ params=list(b0 + b1 + b2 ~ Sisp -1), start=c(strssb0,strssb1,strssb2))
I encountered an error:
"Error in model.frame(formula, rownames, variables, varnames, extras,
extranames, : invalid variable type "
Rht is a defined function to be
2010 Oct 03
1
plyr: a*ply with functions that return matrices-- possible bug in aaply?
I have an application where I have a function to calculate results for
a 2-way table or matrix, which
returns a matrix with one less row and column. To keep this short, the
function below captures the structure:
fun2way <- function(f){
if (!length(dim(f)) ==2) stop("only for 2-way arrays")
R <- dim(f)[1]
C <- dim(f)[2]
f[1:(R-1), 1:(C-1)]
}
Now, I want to
2011 Apr 12
1
extract element from list by rownames
Hi,
I've a list of list.
I want to extract an element by the rownames.
I can extract it by:
data[[1]][[1]][[4]][1]
But I want to exctract it by a command like this:
data[[1]][["B0"]][["smac"]][["cont"]][1]
It's possible?
Thanks,
Alfredo
> str(data)
List of 1
$ :List of 4
..$ :List of 4
.. ..$ : num [1, 1:3] 0.4 0.458 0.5
.. ..$ : num
2009 Nov 10
1
when vectorising does not work: silent function fail?
Dear All,
I'm using apply to do some genetic association analysis along a chromosome, with
many thousands markers. For each marker the analysis is the same, so I was
planning to use apply(chrom, 2, somefunction)
In the specific case I do:
my.results = apply(chr, 2, function(x){anova(lrm( cpstc.f ~ x + time.cpstc + age
+ sex + mri))[1,3]})
This is all good and well in theory, but in
2010 Feb 11
2
SAS and RODBC
I am using R-2.10.1 binary from CRAN on a WinXP Pro system. I also use SAS v9.2 on the same box. I just started using the SAS ODBC driver that comes with version 9 of SAS. I have been able to set up an ODBC source for SAS datasets using the driver, and then with RODBC I am able to read a sample SAS dataset.
> library(RODBC)
> ch <- odbcConnect('sasodbc', believeNRows=FALSE)
2010 Apr 06
2
is.na<- doesn't seem to work with labelled variables?
Dear All,
I seem entirely unable to solve what should be a very simple problem. I
have imported a SPSS dataset into R using spss.get from Frank Harrell's
Hmisc library. The variables are imported classed as 'labelled': missing
values are coded as either the SPSS missing value code, 8 or 88. All are
imported correctly; 8 and 88 being identified as true numbers in the
2004 Jan 01
0
Segmentation fault with data.frame
All,
I have some code that I have been working on that crashes R (1.8.1 on MacOS
X installed from source). Here are excerpts of the code and data
structures. When the lists that I am using to construct the data.frame are
truncated (shortened), R catches the differing rows and warns. However,
when the entire lists are used (I haven't looked for an exact breakpoint or
for a particular list
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
2012 Oct 02
1
ffsave problems
Dear R friends.
After having some troubles learning how to create a ffdf object, now I find
myself having problems saving it.
this is the data i´d like to save:
str(DATA)
List of 3
$ virtual: 'data.frame': 6 obs. of 7 variables:
.. $ VirtualVmode : chr "double" "short" "integer" "integer" ...
.. $ AsIs : logi FALSE FALSE FALSE
2013 Jan 02
2
Read many cvs files
Hello R helpers,
I would like to automate this code for many files of the same type. But I
don´t know how to make it. In particular, i don´t know how to read many
files each one as an r object with the name of the file. Then a for loop
would be sufficient, right?
Many thanks and a happy new year.
Dominic
datos <- read.table('global2001.csv',head=T,sep=';',stringsAsFactors=F)
2003 Sep 03
1
Last line in .Rprofile must have newline (PR#4056)
Full_Name: Henrik Bengtsson
Version: R v1.7.1
OS: WinXP Pro, Solaris 9
Submission from: (NULL) (130.235.2.229)
A colleague of mine who is new to R had problems setting up his .Rprofile and we
tracked it down to the following. On both WinXP and Solaris with Rv1.7.1 we
noticed that the *last* line in .Rprofile has to have a *newline* to be
evaluated. For instance, starting R with the following
2009 Jan 29
4
Text in a character vector to indicate "ifelse" argument
Hello
I have a data set that looks like this;
> b2
dato chr status PRRSvac
PRRSsanVac PRRSsanDk PRRSdk
33 2007-12-03 090432 R?d SPF
34 2007-02-09 090432 R?d SPF+sanDK
35 2002-12-17 090432 R?d SPF+DK
36 2002-11-27 090432 R?d SPF+sanDK
37 2002-07-23
2013 Jan 31
2
rbind Missing Something: Need New Eyes
I don't see what's missing in my statements to add rows to a data frame
and someone else will probably see what needs to be added to the statements.
The data frame has this structure (without any data):
$ PHYLUM : chr
$ SUBPHYLUM : chr
$ SUPERCLASS : chr
$ CLASS : chr
$ SUBCLASS : chr
$ INFRACLASS : chr
$ SUPERORDER : chr
$ ORDER : chr
$ SUBORDER :