similar to: Re: R-help Digest, Vol 18, Issue 12

Displaying 20 results from an estimated 200 matches similar to: "Re: R-help Digest, Vol 18, Issue 12"

2004 Aug 11
1
Fwd: Enduring LME confusion… or Psychologists and Mixed-Effects
In my undertstanding of the problem, the model lme1 <- lme(resp~fact1*fact2, random=~1|subj) should be ok, providing that variances are homogenous both between & within subjects. The function will sort out which factors & interactions are to be compared within subjects, & which between subjects. The problem with df's arises (for lme() in nlme, but not in lme4), when
2004 Aug 10
4
Enduring LME confusion… or Psychologists and Mixed-Effects
Dear ExpeRts, Suppose I have a typical psychological experiment that is a within-subjects design with multiple crossed variables and a continuous response variable. Subjects are considered a random effect. So I could model > aov1 <- aov(resp~fact1*fact2+Error(subj/(fact1*fact2)) However, this only holds for orthogonal designs with equal numbers of observation and no missing values.
2009 Jan 23
3
Table Modification
I am trying to construct a two-way table where, instead of printing the two-way frequencies in the table, I would like to print the values of a third variable that correspond to the frequencies. For example, the following is easily constructed in R > fact1 <- factor(sample(LETTERS[1:3],10,replace=TRUE)) > fact2 <- factor(sample(LETTERS[25:26],10,replace=TRUE)) > fact3
2005 Apr 28
2
Reconstruction of a "valid" expression within a function
Hello all, I have some trouble in reconstructing a valid expression within a function, here is my question. I am building a function : SUB<-function(DF,subset=TRUE) { #where DF is a data frame, with Var1, Var2, Fact1, Fact2, Fact3 #and subset would be an expression, eg. Fact3 == 1 #in a first time I want to build a subset from DF #I managed to, with an expression like eg. DF$Fact3, # but I
2009 Nov 12
1
Rearranging long tables, Sweave, xtable, LaTeX
Dear R-users, consider the two following outputs, ## 1 and ## 2 \begin{Scode}{Setup, echo = FALSE, print = FALSE, eval = TRUE} with(expand.grid(Fact1 = 1:3, Fact2 = 1:40), table(Fact1, Fact2)) ## 1 xtable(with(expand.grid(Fact1 = 1:3, Fact2 = 1:40), table(Fact1, Fact2))) ## 2 \end{Scode} The first line with(expand.grid(Fact1 = 1:3, Fact2 = 1:40), table(Fact1, Fact2))
2002 Jan 22
1
lme and mixed effects
Dear r-help, With lme, is there a way to specify multiple fixed factors under one level of grouping? For example, for a single fixed factor, I use the following: fm1.lme <- lme(fixed=resp ~ fact1, random=~1|subj/fact1, data=mydata) I would like to have multiple factors under subj, like the following for a two-way design, but I get an error: fm2.lme <- lme(fixed=resp ~ fact1*fact2,
2005 Apr 26
0
Construction of a "mean" contengency table
Hi List, Say I have a data.frame "DF" with 6 columns, 3 factors and 3 variables, with different number of repetitions for each combination of factors. I would like to build, for two given factors, a matrix per variable, containing in each cell the mean or sd for a given couple of factors. I have managed to get to the result I wanted step by step, but I would like to have it in a
2007 May 15
3
aov problem
I am using R to make two-way ANOVA on a number of variables using g <- aov(var ~ fact1*fact2) where var is a matrix containing the variables. However the outcome seem to be dependent on the order of fact1 and fact2 (i.e. fact2*fact1) gives a slightly (factor of 1.5) different result. Any ideas why this is? Thanks for any help Anders
2008 Aug 07
2
lattice: add vertical lines in xyplot
Hi list, This is a very basic question about lattice: I wish to add some vertical lines in each panel of a xyplot as demonstrated in this example: > library(lattice) > > xx <- seq(1, 10, length=100) > x <- rep(xx, 4) > y <- c(cos(xx), sin(xx), xx, xx^2/10) > fact <- factor(rep(c("cos", "sin", "id", "square"), each=100))
2003 Jan 27
1
survival bug? (PR#2499)
--Apple-Mail-27-953181986 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed a possible bug with survival analysis - either in R or in SPSS... find more details in bug.doc, and the data in bug.txt best Pius Korner --Apple-Mail-27-953181986 Content-Disposition: attachment Content-Type: multipart/appledouble; boundary=Apple-Mail-28-953181987
2004 Jun 25
2
simple questions
Hello, I am a new user or R, and am so far very impressed with its capabilities. However, I have no programming experience, and am having some issues in trying to tell the software what I want done. There are basically two issues which I am currently grappling with. The first, I have a data matrix, with two factors and dozens of response variables. I am interested on conducting ANOVAs on
2008 Oct 07
2
panel.groups: use group.number to define colors
Dear list, I've been trying this for a few hours and I just don't understand how lattice works with groups and subscripts. Consider the following example, > xx <- seq(1, 10, length=100) > x <- rep(xx, 4) > y <- c(cos(xx), sin(xx), xx, xx^2/10) > fact <- factor(rep(c("cos", "sin", "id", "square"), each=100)) > fact2
2007 Oct 27
1
Selectively swapping labels between factors
Dear R-helpers, I'm trying to selectively swap labels between two factors, depending on an indicator variable i. Can you point me to a solution, and perhaps how I could have found it? labels(fact1) is a character vector of r row numbers levels(fact1) is a character vector of the n < r unique levels How do I then get the character vector of length r of the levels of fact1? Once I have
2013 Apr 05
0
(no subject)
Hello, I am running error rate analysis. It is my results below. When I compare aov1 and aov2, X square = 4.05, p = 0.044, which indicates that adding the factor "Congruity" improved the fitting of model. However, the following Z value is less than 1 and p value for Z is 1, which means that "Congruity" is not significant at all. Therefore, these two parts are not consistent,
2001 Dec 12
1
again evaluations
Hello, I wrote the following function to compute multiple comparisons in a one way anova and randomized blocks anova. aov1 <- function(y,g,s=NULL,comp="mca",meth="Sidak") { # fun <- function(x) c(mean(x,na.rm=T),sd(x,na.rm=T),length(x[!is.na(x)])) # li <- length(unique(g)) cat(" Analysis of Variance with Multiple comparisons\n\n") cat("
2001 Dec 17
1
environments again
In a previous message I was not clear enough in my querry. I have the following program: tst<- function() { x <- c(32.7,32.3,31.5,32.1,29.7,29.1,35.7,35.9,33.1, 36.0,34.2,31.2,31.8,28.0,29.2,38.2,37.8,31.9, 32.5,31.1,29.7) g <- rep(1:7,rep(3,7)) s <- rep(1:3,7) cat(" Only x and g \n") aov1(x,g) cat("\n\n Now x, g and s \n") aov1(x,g,s=s) }
2011 May 21
0
Problem with ANOVA repeated measures: "Error() model is singular"
Hello everybody, I need an help because I don´t know if the command for the ANOVA analysis I am performing in R is correct. Indeed using the function aov I get the following error:"In aov (......) Error() model is singular" The structure of my table is the following: subject, stimulus, condition, sex, response Example: subject stimulus condition sex response
2008 Jul 03
1
ggplot2 legend for vertical lines
Dear all, The following example code produces a graph with ggplot2, to which I add several vertical lines of arbitrary colors. I am not satisfied with the legend: it automatically adds some vertical lines which I'd rather not see (they confuse the reader rather than add information in this case). > library(ggplot2) > dfr <- data.frame(values = sin(1:50/10), > fact =
2004 May 28
1
dotchart questions
I am trying to put 3 dotcharts side-by-side with minimal space between each. Each chart is for a different variable, but the vertical axes are the same. I want to have vertical axis labels on the lefthand chart but no vertical axis labels on the other two. Plus, I would like very little space between charts 1 & 2 and between charts 2 & 3. I have one approach but am not too happy with
2009 Oct 07
0
how to extract the second table from the factanal functions result's loadings part?
Hi All, Can someone help me?The way to do this may be very easy but i do not know. *Question1:----* factanal() function produces the results in this way:-- *RESULTS:--* *>fact1<- factanal(data_withNA,factors=1,rotation="none") >fact1$"loadings"* Loadings: Factor1 i1 0.784 i2 0.874 i3 0.786 i4 0.839 i5 0.778 i6 0.859 i7 0.850 i8 0.763 i9 0.810 i10 0.575