Displaying 20 results from an estimated 10000 matches similar to: "Systematic treatment of missing values"
2007 Jul 12
1
how to estimate treatment-interaction contrasts
Hello, R experts,
Sorry for asking this question again again since I really want a help!
I have a two-factor experiment data and like to calculate estimates of
interation contrasts say factor A has levels of a1, a2, and B has
levels of b1, b2, b3, b4, and b5 with 3 replicates. I am not sure the
constrast estimate I got is right using the script below:
2008 Mar 05
1
coxme - fitting random treatment effect nested within centre
Dear all,
I am using "coxme" function in Kinship library to fit random treatment effect nested within centre. I got 3 treatments (0,1,2) and 3 centres. I used following commands, but got an error.
> ugroup=paste(rep(1:3,each=3),rep(0:2,3),sep='/')
> mat1=bdsmatrix(rep(c(1,1,1,1,1,1,1,1,1),3),blocksize=rep(3,3),dimnames=list(ugroup,ugroup))
>
2005 Feb 20
1
Treatment-Contrast Interactions
Hello all,
(Apologies in advance if my terminology is incorrect, I'm relatively new
to R and statistics).
I have data from a factorial design with two treatments (CRF-23), and
I'm trying to compute treatment-contrast interactions through analysis
of variance. I can't figure out how to do contrasts properly, despite
reading the help for "C" and "contrasts"
2005 May 19
0
Random/systematic selection of rows in a matrix
Hi R people:
I am new to R. I am writing a function to (1) produce a sparse
stochastic Gaussian 2D field and (2) perform a systematic
transect sampling on this field, this carried out many times
in a simulation framework. My function does a good job at
producing the random field (a matrix of zeros and some
manifestations of the stochastic process, depending on a
parameter of the function
2008 May 20
1
contr.treatments query
Hi Folks,
I'm a bit puzzled by the following (example):
N<-factor(sample(c(1,2,3),1000,replace=TRUE))
unique(N)
# [1] 3 2 1
# Levels: 1 2 3
So far so good. Now:
contrasts(N)<-contr.treatment(3, base=1, contrasts=FALSE)
contrasts(N)
# 1 2
# 1 1 0
# 2 0 1
# 3 0 0
whereas:
contr.treatment(3, base=1, contrasts=FALSE)
# 1 2 3
# 1 1 0 0
# 2 0 1 0
# 3 0 0 1
contr.treatment(3, base=1,
2009 Jul 29
1
Systematic resampling (in sequential Monte Carlo)
Dear all,
Here is a little coding problem. It falls in the category of "how can I do
this efficiently?" rather than "how can I do this?" (I know how to do it
inefficiently). So, if you want to take the challenge, keep reading, otherwise
just skip to the next post - I won't be offended by that ;-)
I am coding a particle filter and I want to use systematic resampling to
2006 Feb 07
0
lme and Assay data: Test for block effect when block is systematic - anova/summary goes wrong
Consider the Assay data where block, sample within block and dilut within block is random.
This model can be fitted with (where I define Assay2 to get an ordinary data frame rather
than a grouped data object):
Assay2 <- as.data.frame(Assay)
fm2<-lme(logDens~sample*dilut, data=Assay2,
random=list(Block = pdBlocked(list(pdIdent(~1), pdIdent(~sample-1),pdIdent(~dilut-1))) ))
Now, block
2011 Oct 06
1
Issue with read.csv treatment of numerics enclosed in quotes (and a confession)
Dear Help-Rs,
I've been dealing with this problem for some time, using a work-around to deal with it. It's time for me to come clean with my ineptitude and seek a what has got to be a more streamlined solution from the Help-Rverse.
I regularly import delimited text data that contains numerics enclosed in quotes (e.g., "00765288071"). Thing is, for some of these data, I need
2010 Jul 07
2
Sum vectors and numbers
We want to sum many vectors and numbers together as a vector if there is
at least one vector in the arguments.
For example, 1 + c(2,3) = c(3,4).
Since we are not sure arguments to sum, we are using sum function:
sum(v1,v2,...,n1,n2,..).
The problem is that sum returns the sum of all the values present in its
arguments:
sum(1,c(2,3))=6
sum(1,2,3)=6
We do not want to turn sum(v1,v2,...,n1,n2,..) to
2011 Dec 21
2
unique combinations
Hi there,
I have a vector and would like to create a data frame, which contains
all unique combination of two elements, regardless of order.
myVec <- c(1,2,3)
what expand.grid does:
1,1
1,2
1,3
2,1
2,2
2,3
3,1
3,2
3,3
what I would like to have
1,1
1,2
1,3
2,2
2,3
3,3
Can anybody help?
2008 Sep 03
2
ANCOVA/glm missing/ignored interaction combinations
Hi
I am using R version 2.7.2. on a windows XP OS and have a question
concerning an analysis of covariance with count data I am trying to do,
I will give details of a scaled down version of the analysis (as I have
more covariates and need to take account of over-dispersion etc etc) but
as I am sure it is only a simple problem but I just can't see how to fix
it.
I have a data set with count
2007 Jun 27
3
exaustive subgrouping or combination
Dear Colleagues,
I am looking for a package or previous implemented R to subgroup and
exaustively divide a vector of squence into 2 groups.
For example:
1, 2, 3, 4
I want to have a group of
1, (2,3,4)
(1,2), (3,4)
(1,3), (2,4)
(1,4), (2,3)
(1,2,3), 4
(2,3), (1,4)
...
Can someone help me as how to implement this? I get some imaginary problem
when the sequence becomes large.
Thanks much in
2013 Jan 19
1
dummy encoding in metafor
Hi,
I am quite new to R and in need of some advice. I am trying to conduct a meta regression over a some studies with about 7 mod variables which I have to dummy encode.
I have found the following piece of code in the manual for the metafor library:
### manual dummy coding of the allocation factor
alloc.random <- ifelse(dat$alloc == "random", 1, 0)
alloc.alternate <-
2008 Feb 04
3
counts of each column that are not NA, and/or greater than column means
Hi,
Given a test matrix, test <- matrix(c(1,2,3,NA,2,3,NA,NA,2), 3,3)
A) How to compute the counts of each column (excluding the NA) i.e., 3, 2, 1
B) How to compute the counts of each column (excluding the NA) that are
greater than the column means ? i.e., 1, 1, 0
I could write a for loop, but hope to use better alternative.
[[alternative HTML version deleted]]
2009 Feb 25
8
learning R
I was wondering why the following doesn't work:
> a=c(1,2)
> names(a)=c("one","two")
> a
one two
1 2
>
> names(a[2])
[1] "two"
>
> names(a[2])="too"
> names(a)
[1] "one" "two"
> a
one two
1 2
I must not be understanding some basic concept here.
Why doesn't the 2nd name change to
2009 Feb 25
8
learning R
I was wondering why the following doesn't work:
> a=c(1,2)
> names(a)=c("one","two")
> a
one two
1 2
>
> names(a[2])
[1] "two"
>
> names(a[2])="too"
> names(a)
[1] "one" "two"
> a
one two
1 2
I must not be understanding some basic concept here.
Why doesn't the 2nd name change to
2011 Sep 03
2
problem in applying function in data subset (with a level) - using plyr or other alternative are also welcome
Dear R experts.
I might be missing something obvious. I have been trying to fix this problem
for some weeks. Please help.
#data
ped <- c(rep(1, 4), rep(2, 3), rep(3, 3))
y <- rnorm(10, 8, 2)
# variable set 1
M1a <- sample (c(1, 2,3), 10, replace= T)
M1b <- sample (c(1, 2,3), 10, replace= T)
M1aP1 <- sample (c(1, 2,3), 10, replace= T)
M1bP2 <- sample (c(1, 2,3), 10, replace= T)
2006 Jun 20
2
multi-dimension array of raw
I would like to store and manipulate large sets of marker genotypes
compactly using "raw" data arrays. This works fine for vectors or
matrices, but I run into the error shown in the example below as soon
as I try to use 3 dimensional arrays (eg. animal x marker x allele).
> a <- array(as.raw(1:6),c(2,3))
> a
[,1] [,2] [,3]
[1,] 01 03 05
[2,] 02 04 06
>
2008 Apr 21
2
Trend test for survival data
Hello,
is there a R package that provides a log rank trend test
for survival data in >=3 treatment groups?
Or are there any comparable trend tests for survival data in R?
Thanks a lot
Markus
--
Dipl. Inf. Markus Kreuz
Universitaet Leipzig
Institut fuer medizinische Informatik, Statistik und Epidemiologie (IMISE)
Haertelstr. 16-18
D-04107 Leipzig
Tel. +49 341 97 16 276
Fax. +49 341 97 16
2006 Oct 05
2
treatment effect at specific time point within mixedeffects model
Hi David:
In looking at your original post it is a bit difficult to ascertain
exactly what your null hypothesis was. That is, you want to assess
whether there is a treatment effect at time 3, but compared to what. I
think your second post clears this up. You should refer to pages 224-
225 of Pinhiero and Bates for your answer. This shows how to specify
contrasts.
> -----Original Message-----