Displaying 20 results from an estimated 7000 matches similar to: "Off topic: SS formulae for 3-way repeated measure anova (for when aov() fails)"
2008 Jul 15
1
aov error with large data set
I'm looking to analyze a large data set: a within-Ss 2*2*1500 design
with 20 Ss. However, aov() gives me an error, reproducible as follows:
id = factor(1:20)
a = factor(1:2)
b = factor(1:2)
d = factor(1:1500)
temp = expand.grid(id=id, a=a, b=b, d=d)
temp$y = rnorm(length(temp[, 1])) #generate some random DV data
this_aov = aov(
y~a*b*d+Error(id/(a*b*d))
, data=temp
)
While yields the
2008 Dec 17
1
repeated measures aov with weights
Dear R-help,
I'm facing a problem with defining a repeated measures anova with
weighted data.
Here's the code to reproduce the problem:
# generate some data
seed=11
rtrep <- data.frame(rt=rnorm(100),ti=rep(1:5,20),subj=gl
(20,5,100),we=runif(100))
# model with within factor for subjects/repeated measurements, no
problem
aov(rt~ti + Error(subj/ti),data=rtrep)
#model with weights
2006 Mar 28
1
variables as arguments in formulae in aov?
Hi all,
I wonder if you could help me with (what is surely) a simple R question?
I've written a simple R script (attached) to perform multiple ANOVAs
on the columns in a table loaded in from a a file (also attached). I
loop through the list of columns for which I want to perform the
ANOVAs, storing the column name in a variable. When I try to perform
the ANOVA using the variable name as a
2001 Jul 19
0
Correction of degrees of freedom in repeated measure aov
Hi there,
some statistical programs (e.g. SPSS) calculate a correction of the
degrees of freedom in a repeated measure analysis of variance (see
Greenhouse-Geisser (1958) or Huynh-Feld (1976)) by a factor epsilon.
This factor is used to correct the deg. of freedom to get a corrected
f-test. Is this also possible with R?
Thanks, Sven
P.S.: I read in the lm help page:
singular.ok logical,
2009 Jun 15
3
lack of memory for logistic regression in R?
Hi all,
I am getting the following error message:
> mymodel = glm(response ~ . , family=binomial, data=C);
Error: cannot allocate vector of size 734.2 Mb
In addition: Warning messages:
1: In array(0, c(n, n), list(levs, levs)) :
Reached total allocation of 1535Mb: see help(memory.size)
2: In array(0, c(n, n), list(levs, levs)) :
Reached total allocation of 1535Mb: see help(memory.size)
3:
2009 Sep 30
5
Condition to factor (easy to remember)
Dear List,
creating factors in a given non-default orders is notoriously difficult to
explain in a course. Students love the ifelse construct given below most,
but I remember some comment from Martin M?chler (?) that ifelse should be
banned from courses.
Any better idea? Not necessarily short, easy to remember is important.
Dieter
data = c(1,7,10,50,70)
levs =
2012 May 29
1
lattice: add a marginal histogram on top of the colorkey of a levelplot?
Lattice experts:
Can you think of a way to produce a levelplot as below and then add a histogram of the z variable to the top margin of the plot that would sit on top of the color key?
x <- seq(pi/4, 5 * pi, length.out = 100)
y <- seq(pi/4, 5 * pi, length.out = 100)
r <- as.vector(sqrt(outer(x^2, y^2, "+")))
grid <- expand.grid(x=x, y=y)
grid$z <- cos(r^2) *
2007 Apr 15
1
unable to find inherited method for function "edges", for signature "ugsh", "missing"
I am new to using S4 methods and have run into this problem (on Windows XP using R 2.4.1): I am writing a package in which I use the graph package. I define my own classes of graphs as:
setOldClass("graphsh")
setOldClass("ugsh")
setIs("ugsh", "graphsh")
(I know that I "should have" used setClass instead - and I will eventually - but right now
2006 Dec 02
0
fixup for debug package and R2.4.0
A number of users have spotted a terminal problem with the 'debug' package under R2.4.0, along the lines of
> mtrace(x)
> x()
Error in attr(value, "row.names") <- rlabs :
row names must be 'character' or 'integer', not 'double'
This arose from a bug in 'rbind.data.frame' in R2.4.0 itself. The bug is fixed in R2.4.0 patched, so the
2002 Mar 17
2
using "by" and indicies
I sent this to the list last week, and haven't seen it pop up. Either
I deleted it when it did appear, or possibly it was destroyed as
spam...? If it did appear and I somehow missed it, appologies.
In a nutshell, can the function FUN supplied to by() deduce
what level of factor by() was on when FUN was called? I've
been digging through the functions, and can't see where the
2007 Jan 12
0
Minor logical bug in rbind.data.frame ?
When attempting to merge 3 data frames, one of which has fewer columns
than the others, rbind.data.frame correctly refuses to perform the bind.
However, the error message given is a bit obscure due to a logical
bug in the match.names() internal function to rbind.data.frame.
Illustration:
## Three data frames with same column variable names:
> foo <- data.frame(v1 = c('a',
2011 Nov 15
1
equal spacing of the polygons in levelplot key (lattice)
Given the example:
R> (levs <- quantile(volcano,c(0,0.1,0.5,0.9,0.99,1)))
0% 10% 50% 90% 99% 100%
94 100 124 170 189 195
R> levelplot(volcano,at=levs)
How can I make the key categorical with the size of the divisions equally spaced in the key? E.g., five equal size rectangles with labels at levs c(100,124,170,189,195)?
Apologies if this is obvious.
-A
R> version
2017 Nov 25
0
Function 'factor' issues
>From commits to R devel, I saw attempts to speed up subsetting and 'match', and to cache results of conversion of small nonnegative integers to character string. That's good.
I am sorry for pushing, still.
Is the partial new behavior of function 'factor' with respect to NA really worthy?
match(xlevs, nlevs)[f] looks nice, too.
- Using
f <- match(xlevs, nlevs)[f]
2017 Oct 18
0
Function 'factor' issues
>>>>> Suharto Anggono Suharto Anggono via R-devel <r-devel at r-project.org>
>>>>> on Sun, 15 Oct 2017 16:03:48 +0000 writes:
> In R devel, function 'factor' has been changed, allowing and merging duplicated 'labels'.
Indeed. That had been asked for and discussed a bit on this
list from June 14 to June 23, starting at
1999 May 05
1
Ordered factors , was: surrogate poisson models
For ordered factor the natural contrast coding would be to parametrize by
the succsessive differences between levels, which does not assume equal
spacing
of factor levels as does the polynomial contrasts (implicitly at least).
This requires the contr.cum, which could be:
contr.cum <- function (n, contrasts = TRUE)
{
if (is.numeric(n) && length(n) == 1)
levs <- 1:n
2002 Dec 01
1
generating contrast names
Dear R-devel list members,
I'd like to suggest a more flexible procedure for generating contrast
names. I apologise for a relatively long message -- I want my proposal to
be clear.
I've never liked the current approach. For example, the names generated by
contr.treatment paste factor to level names with no separation between the
two; contr.sum simply numbers contrasts (I recall an
2017 Oct 21
0
Function 'factor' issues
My idea (like in https://bugs.r-project.org/bugzilla/attachment.cgi?id=1540 ):
- For remapping, use
f <- match(xlevs, nlevs)[f]
instead of
f <- match(xlevs[f], nlevs)
(I have mentioned it).
- Remap only if length(nlevs) differs from length(xlevs) .
On use of 'order' in function 'factor' in R devel, factor.Rd still says 'sort.list' in "Details" section.
My
2018 Mar 24
1
Function 'factor' issues
I am trying once again.
By just changing
f <- match(xlevs[f], nlevs)
to
f <- match(xlevs, nlevs)[f]
, function 'factor' in R devel could be made more consistent and back-compatible. Why not picking it?
--------------------------------------------
On Sat, 25/11/17, Suharto Anggono Suharto Anggono <suharto_anggono at yahoo.com> wrote:
Subject: Re: [Rd] Function
2017 Oct 15
2
Function 'factor' issues
In R devel, function 'factor' has been changed, allowing and merging duplicated 'labels'.
Issue 1: Handling of specified 'labels' without duplicates is slower than before.
Example:
x <- rep(1:26, 40000)
system.time(factor(x, levels=1:26, labels=letters))
Function 'factor' is already rather slow because of conversion to character. Please don't add slowdown.
2005 Sep 08
0
Effect of data set size on calculation
Dear listers,
I have a piece of code which performs an ANOVA type of analysis on 2D GC
data. The code is shown below:
# ANOVA 2D GC analysis
# maxc <- number of samples
# nreps <- number of samples
maxc <- 2
nreps <- 4
sscl <- NULL
cmean <- NULL
#
# Initial stat. variable
#
dftot <- nrow(mat)-1
dfcl <- maxc - 1
dferr <- dftot - dfcl
totmean