Displaying 20 results from an estimated 20000 matches similar to: "help with 'lm' function: contrast and separate variance terms"
2009 Sep 20
2
missing level of a nested factor results in an NA in lm output
Hello All,
I have posted to this list before regarding the same issue so I
apologize for the multiple e-mails. I am still struggling with this
issue so I thought I'd give it another try. This time I have included
reproducible code and a subset of the data I am analyzing.
I am running an ANOVA with three factors: GROUP (5 levels), FEATURE
(2 levels), and PATIENT (2 levels), where
2009 Nov 05
1
help with ols and contrast functions in Design library
Dear All,
I'm trying to use the ols function in the Design library (version
2.1.1) of R to estimate parameters of a linear model, and then use the
contrast function in the same library to test various contrasts.
As a simple example, suppose I have three factors: feature (3
levels), group (2 levels), and patient (3 levels). Patient is coded
as a non-unique identifier and is
2001 Jun 15
1
contrasts in lm and lme
I am using RW 1.2.3. on an IBM PC 300GL.
Using the data bp.dat which accompanies
Helen Brown and Robin Prescott
1999 Applied Mixed Models in Medicine. Statistics in Practice.
John Wiley & Sons, Inc., New York, NY, USA
which is also found at www.med.ed.ac.uk/phs/mixed. The data file was opened
and initialized with
> dat <- read.table("bp.dat")
>
2007 Feb 14
1
nested model: lme, aov and LSMeans
I'm working with a nested model (mixed).
I have four factors: Patients, Tissue, sex, and tissue_stage.
Totally I have 10 patients, for each patient, there are 2 tissues
(Cancer vs. Normal).
I think Tissue and sex are fixed. Patient is nested in sex,Tissue is
nested in patient, and tissue_stage is nested in Tissue.
I tried aov and lme as the following,
> aov(gene ~ tissue + gender +
2009 Jul 10
1
problems with contrast matrix
Dear lme and lmer -ers,
I have some problems using "home-made" contrast matrix in lme and lmer.
I
did an experiment to investigate the relationship between the response of an animal and some factors, namely the light wavelength (WA), the light intensity to which this animal was exposed and the sex of the animal
tested.
- The response can be a variable LA (normal
distribution) or
2009 Aug 26
1
Within factor & random factor
Hi,
I am quite new to R and trying to analyze the following data. I have 28
controls and 25 patients. I measured X values of 4 different locations
(A,B,C,D) in the brain image of each subject. And X ranges from 0 to 1.
I think "control or patient" is a between subject factor and location is
a within subject factor. So,
controls: 28
patients: 25 (unbalanced data set)
respone measure:
2012 Oct 05
1
LMMs with some variance terms forced constant
Hello,
I have been asked to help perform a meta-analysis with individual- and aggregate-level data. I found a nice article on this, and the idea is easy to understand: use a mixed effects models, but for the studies where there is only aggregate level data, force the variance to be that which was observed. Unfortunately, I am struggling to see how to implement this in R. I am familiar with
2007 Apr 09
1
Repeated Measures design using lme
Hi,
I have what I believe is a repeated-measures dataset that I'm trying to analyze using lme(). This is *not* homework, but an exercise in my trying to self-teach myself repeated-measure ANOVA for other *real* datasets that I have and that are extremely similar to the following design.
I'm fairly sure the dataset described below would work with lme() -- but it'd be great if anybody
2009 Aug 28
1
how to explain the interaction terms regarding "treatment contrast" of lm model
Dear list,
I am confused on how to explain the interaction term in the context of
"treatment contrast".
for example, I have an data frame as below:
sub group val
1 a group1 3.685625
2 a group1 3.407445
3 a group1 4.040920
4 a group1 2.890875
5 b group1 3.853280
6 b group1 4.113585
7 b group1 3.043250
8 b group1 3.800920
9 c group1 5.394305
10 c
2007 Sep 27
1
Getting intervals for within-group standard errors for each group using nlme and varIdent
I am using lme from the nlme package to fit a mixed model. We have observations nested in patients(encounters) and patients nested in groups (2 different treatments). We are interested in the differences between the 2 groups, both the means and the standard deviations (are patients in group A less variable than those in group B? both within patient and between patient within group).
Here is
2006 Jul 31
1
Random Effects Model with Interacting Covariates
Hi
I have been asked by a colleague to perform a statistical analysis
which uses random effects - but I am struggling to get this to work
with nlme in R. Help would be very much appreciated!
Essentially, the data consists of:
10 patients. Each patient has been given three different treatments (on
three separate days). 15 measurements (continuous variable) have been
taken from each patient
2008 Jul 04
1
Repeated measures lme or anova
Hi
As I can't find an example of my data structure I'd like some advice on which is the most appropriate test for significant effects. If I should be using either lme or anova, is the relevant example below the best/correct way to do the test?
The Data...
2 groups of patients (5 in GroupA, 7 in GroupB)
3 short acting drugs, (I'm not concerned with residual effects from the previous
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-----
2006 Jul 31
0
Three questions about a model for possibly periodic data with varying amplitude
Hi dear R community,
I have up to 12 measures of a protein for each of 6 patients, taken
every two or three days. The pattern of the protein looks periodic,
but the height of the peaks is highly variable. It's something like
this:
patient <- data.frame(
day = c(1, 3, 5, 8, 10, 12, 15, 17, 19, 22, 24, 26),
protein = c(5, 3, 10, 7, 2, 8, 25, 12, 7, 20, 10, 5)
)
plot(patient$day,
2007 Oct 09
2
fit.contrast and interaction terms
Dear R-users,
I want to fit a linear model with Y as response variable and X a categorical variable (with 4 categories), with the aim of comparing the basal category of X (category=1) with category 4. Unfortunately, there is another categorical variable with 2 categories which interact with x and I have to include it, so my model is s "reg3: Y=x*x3". Using fit.contrast to make the
2006 Sep 26
2
treatment effect at specific time point within mixed effects model
All,
The code below is for a pseudo dataset of repeated measures on patients
where there is also a treatment factor called "drug". Time is treated
as categorical.
What code is necessary to test for a treatment effect at a single time
point,
e.g., time = 3? Does the answer matter if the design is a crossover
design,
i.e, each patient received drug and placebo?
Finally, what would
2006 Jun 19
2
Nested variance-covariance matrix in Multilevel model
Dear R community,
I have trouble implementing a nested variance-covariance matrix in the
lme function.
The model has two fixed effects called End and logpgc, the response
variable is the logarithm to base 2 of Intensity ( log2(Intensity) )
and the random effects are called Probe and ProbeNo.
The model has the following nesting structure: A Pixel is nested within
the ProbeNo,the ProbeNo is
2008 Feb 05
1
Extracting level-1 variance from lmer()
All,
How does one extract the level-1 variance from a model fit via lmer()?
In the code below the level-2 variance component may be obtained via
subscripting, but what about the level-1 variance, viz., the 3.215072 term?
(actually this term squared) Didn't see anything in the archives on this.
Cheers,
David
> fm <- lmer( dv ~ time.num*drug + (1 | Patient.new), data=dat.new )
2002 Oct 02
1
Parameterisation of interaction terms in lm
Hello,
I have a 2 factor linear model, in which the only terms I am interested
in estimating and
testing are the interaction terms. I want to control for the main
effects but have no interest
in estimating or testing them. However, I would like an estimate of the
interaction effects
for every level of the interactions, whereas what I get is one fewer
estimate than this, with the
first level
2013 Sep 01
0
Question About Markov Models
Dear All,
I am a bit struggling with the many packages for Markov models available
in R.
Apologies for now posting a code snippet, but I am looking for some
guidance here.
Please consider a set like the one below (which you can get with
data<-read.csv('http://dl.dropboxusercontent.com/u/5685598/data_table.csv')
).
ID therapy age1 age2 EFS
7308 ormo_lunga 78