Displaying 20 results from an estimated 5000 matches similar to: "simple question about contrasts, lm and factors"
2010 Sep 16
1
ANOVA - more sophisticated contrasts
dear list,
i am using a multifactorial design with two treatments (factor A: drugs,
three levels; factor B: theraphy, two levels) and a time factor (three
levels, different timepoint). hypothetically, i measured the same subjects
for all treatements and timepoints, so its a repeated measurement design.
now i ran an anova in R and also some Tukey post-hoc tests using glht. but
what i am actually
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 )
2008 Sep 11
1
plot of all.effects object
All,
I'm trying to plot an all.effects() object, as shown in the help for
all.effects and also Crawley's R book (p.178, 2007). The data has a repeated
measures structure, but I'm using all.effects for the simple lm() fit here.
Below is a reproducible example that yields the error message.
fm.ex = lm(dv ~ time.num*drug*X, data = dat.new)
fm.effects = all.effects(fm.ex, xlevels =
2008 Aug 26
2
options("contrasts")
Code:
> options("contrasts")
$contrasts
factor ordered
"contr.treatment" "contr.poly"
I want to change the first entry ONLY, without retyping "contr.poly". How do
I do it? I have tried various possibilities and cannot get anything to work.
I found out that the response to options("contrasts") has class
2005 Feb 07
1
Incorrect behavior for ordering timepoints in "reshape" (PR#7669)
Full_Name: Dav Clark
Version: 2.0.1
OS: OS X 10.3
Submission from: (NULL) (128.122.87.35)
When the timepoints that reshape uses (in direction="long") are negative or
fractional, the time label is assigned incorrectly. It is easier to give an
example than to describe the problem abstractly:
Assume you have a data.frame header with values related to peri-stimulus time
like this:
2009 Jun 08
1
Looking for easy way to normalize data by groups
Hi,
i do have a dataframe representing data from a repeated experiment. PID
is a subject identifier, Time are timepoints in an experiment which was
repeated twice. For each subject and all three timepoints there are 2
sets of four values.
df <- data.frame(PID = c(rep("A", 12), rep("B", 12), rep("C", 12)),
Time = rep(c(0, 0, 0, 0, 30, 30, 30,
2008 May 28
1
heatmap-changing column or row names
Dear R Community,
I am trying to create an heatmap for the following set of data:
##example of data matrix
o4
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18
green 27 28 29 29 28 28 26 25 25 23 23 22 22 21 21 22 22 22
yellow 6 8 8 7 7 7 6 6 6 7 7 7 6 6 6 6 6 5
red 15 15 15 15 15 15 14 13 12 11 12 10 9 8 7 6 8 9
pink
2008 Apr 28
2
F values from a Repeated Measures aov
Hi Folks,
I have repeated measures for data on association time (under 2
acoustic condtions) in male and female frogs as they grow to adulthood
(6 timepoints). Thus, two within-subject variables (Acoustic
Condition: 2 levels, Timepoint: 6 levels) and one between-subject
variable (Sex:male or female).
I am pretty sure my distributions depart from normality but I would
first like to simply run a
2009 Oct 25
3
Importing data from text file with mixed format
Hi,
I'm having difficulty importing my textfile that looks something like this:
#begin text file
Timepoint 1
ObjectNumber Volume SurfaceArea
1 5.3 9.7
2 4.9 8.3
3 5.0 9.1
4 3.5 7.8
Timepoint 2
ObjectNumber Volume SurfaceArea
1 5.1
2009 Oct 19
1
Reposting various problems with two-way anova, lme, etc.
Hi,
I posted the message below last week, but no answers, so I'm giving it
another attempt in case somebody who would be able to help might have missed
it and it has now dropped off the end of the list of mails.
I am fairly new to R and still trying to figure out how it all works, and I
have run into a few issues. I apologize in advance if my questions are a bit
basic, I'm also no
2009 Sep 02
2
Average over data sets
Hello,
I have a number of files output1.dat, output2.dat, ... , output20.dat,
each of which monitors several variables over a fixed number of
timepoints. From this I want to create a data frame which contains the
mean value between all files, for each timepoint and each variable.
The code below works, but it seems like I should be able to do the
second part without a for loop. I played
2010 Sep 19
1
boyplots nearly identical but still highly significant effect?
dear list,
i am running a within-design ANOVA with 4 factors (4,4,2 and 2 levels each).
the last one is a time factor comprising two different treatment timepoints.
i fit a mixed-effects model using lme and apply the anova function to the
outcome. according to this analysis, there are highly significant main
effect on the first and the time factor. i then checked the boxplots for the
two 4-level
2007 Nov 20
1
Vectorization/Speed Problem
Hi,
I cannot find a 'vectorized' solution to this 'for loop' kind of problem.
Do you see a vectorized, fast-running solution?
Objective:
Take the value of X at each timepoint and calculate the corresponding value
of Y. Leading 0's and all 1's for X are assigned to Y; otherwise Y is
incremented by the number of 0's adjacent to the last 1. The frequency and
2007 Jun 24
2
adding lines to stripchart
I have two points of collection across 20 subjects (pre and post for each),
so 20 pairs of data points. I would like to plot the actual raw data points
for each subject for both pre and post and connect lines between these two
points (20 in all) to depict real change between the two timepoints.
I have tried using stripchart which adequately plots the two lines of
subject data points. Attempting
2010 Jun 10
1
do faster ANOVAS
Dear all R users,
I want to realize 800 000 ANOVAS and to store Sum of Squares of the effects. Here is an extract of my table data
Product attribute subject rep t1 t2 t3 … t101
P1 A1 S1 R1 1 0 0 … 1
I want to realize 1 ANOVA per timepoint and per attribute, there are 101 timepoints and 8 attributes so I want to realize 808 ANOVAS. This will be an ANOVA with two factors :
Here is one example:
2011 Aug 03
1
Coefficient names when using lm() with contrasts
Dear R Users,
Am using lm() with contrasts as below. If I skip the contrasts()
statement, I get the coefficient names to be
> names(results$coef)
[1] "(Intercept)" "VarAcat" "VarArat" "VarB"
which are much more meaningful than ones based on integers.
Can anyone tell me how to get R to keep the coefficient names based on the
factor levels
2004 Oct 12
1
lm#contrasts#one level in factor: bug or feature
(R.1.9.1; win2000)
Since it's about the tenth time I had to write an "if" around this to catch the error ...
Let's look at the line
myfit<-lm(res~groupvar,data=Data)
Here res is of numeric type and groupvar is a factor. On first sight, it would be logical that if groupvar had only one (single) level we would get:
Error in "contrasts<-"(`*tmp*`, value =
2007 Jul 31
2
contrasts error message in lm
Dear all,
I would like to find a linear regression model for a rather large dataset
(27 independent variables). However, when I run lm the following error is
reported:
> out <- lm(Result ~ AppealA + AppealsB + AppealC + AppealD + AppealE +
Apply + ApplyAmount + Aprove + Closecase + Decidelocally + Healthassessment +
HealthassessmentHealth + Postponedecision + Propertyassessment +
2010 Jun 03
2
moving average on irregular time series
Hi all,
I wonder if there is any way to calculate a moving average on an
irregular time series, or use the rollapply function in zoo?
I have a set of dates where I want to check if there has been an event
14 days prior to each time point in order to mark these timepoints for
removal, and can't figure out a good way to do it.
Many thanks in advance!
Gustaf
Example data:
2004 Dec 02
1
treatment contrasts and summary.lm
Dear list members,
I have a 2-factor ANOVA where the summary.lm output looks like this
(using treatment contrasts):
Value Std. Error t value Pr(>|t|)
(Intercept) 0.0389 0.0220 1.7695 0.0817
as.factor(Block)1 0.0156 0.0066 2.3597 0.0215
as.factor(Block)2 -0.0018 0.0037 -0.4857 0.6289
as.factor(Block)3 -0.0007 0.0026 -0.2812 0.7795