search for: factor2

Displaying 20 results from an estimated 87 matches for "factor2".

Did you mean: factor
2009 Dec 11
3
Correcting for missing data combinations
I can think of many brute-force ways to do this outside of R, but was wondering if there was a simple/elegant solution within R instead. I have a table that looks something like the following: Factor1 Factor2 Value A 11/11/2009 5 A 11/12/2009 4 B 11/11/2009 7 B 11/13/2009 8 >From that I need to generate all permutations of Factor1 and Factor2 and force a 0 for any combination that doesn?t exist in the actual data table. By way of example, I?d like the output for above to end up as: Factor1 Facto...
2002 Nov 29
2
Obtaining the variable names of a glm object
...ing for? -----Original Message----- From: Kenneth Cabrera [mailto:krcabrer at epm.net.co] Sent: 29 November 2002 10:36 Cc: R-help at stat.math.ethz.ch Subject: [R] Obtaining the variable names of a glm object Hi, R users! Suppose I make a model like this: model1<-glm(resp~var1+var2+factor1+factor2+var1:factor1+var1:factor1+var2:factor2+var2:factor2,family=poisson) where "resp" is a response variable (poisson distributed) "var1" and "var2" are continuous variables and "factor1" and "factor2" are nominal variables (here I use them as dummy...
2003 Mar 06
6
type III Sum Sq in ANOVA table - Howto?
Hello, as far as I see, R reports type I sums of squares. I'd like to get R to print out type III sums of squares. e.g. I have the following model: vardep~factor1*factor2 to get the type III sum of squares for factor1 I've tried anova(lm(vardep~factor2+factor1:factor2),lm(vardep~factor1*factor2)) but that didn't yield the desired result. Could anyone give me a hint how to proceed? thanks in advance Josef
2010 Jan 12
3
How to get minimum value by group
I'd like to get a long data set of minimum values from groups in another data set. The following almost does what I want. (Note, I'm using the word factor differently from it's meaning in R; bad choice of words) myframe = data.frame(factor1 = rep(1:2,each=8), factor2 = rep(c("a","b"),each=4, times=2), factor3 = rep(c("x","y"),each=2, times=4), y=1:16) attach(myframe) minimums = by(y, list(factor1, factor2,factor3), min) detach(myframe) The problem is that "minimums" is object of class "by", which look...
2004 Jul 29
2
aov for unbalanced design (PR#7144)
...he sum of squares for only for the second factor and total are computed correctly, but sum of squares for the first factor is computed incorreclty. Changing order of factors in the formula changes the ANOVA table. For the balanced design, there is no such problem. > summary(aov(data[1,]~factor1+factor2)) Df Sum Sq Mean Sq F value Pr(>F) factor1 5 1524420 304884 6.4529 0.0003229 *** factor2 7 1447830 206833 4.3776 0.0017808 ** Residuals 31 1464674 47248 --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ...
2010 Jun 06
1
Why did TukeyHSD not work when I used it for post-hoc for 2way within-subjects anova?
...ycholinguistic study that combined a 2 by 2 design and a latin square design. Specifically, I had 32 items each of which generated 4 conditions. Participants saw each of the 32 items only once: 8 in Condition A, 8 in B, 8 in C, and 8 in D. The table below serves as an example. *Subject* *Factor1* *Factor2* *Condition* *ReadingTime* *Item* 1 A A A 238 Item1 1 A A A 369 Item5 1 A A A 494 Item9 *.* *.* *.* *.* *.* *.* *.* *.* *. * *.* *.* *.* 1 B A C 294 Item22 1 B A C 694 Item26 *.* *.* *.* *.* *.* *.* *.* *.* *.* *.* *.* *.* 8 A A A 334 Item3 8 A A A 366 Item7 *.* *.* *.* *.* *.* *.* *.* *.* *.* *.*...
2002 Nov 29
4
reference
Hello R How do I refer to you in a publication? Many Thanks Ross Maller -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
2009 Dec 08
1
{Lattice} help.
...ing stacked values of "R" and "S". Is it possible using barchart() function? OR, if someone can give me some suggestions on the best way to present such data. Any help would be highly appreciated. # Reading data in object "foo" barchart(foo$Value ~ foo$Factor1 | foo$Factor2, data = foo, groups = foo$Factor3, stack = TRUE, auto.key = list(points = FALSE, rectangles = TRUE, space = "right")) barchart(foo$Value ~ foo$Factor1 | foo$Factor2, data = foo, groups = foo$Factor3, stack = FALSE, auto.key = list(points = FALSE, rectan...
2009 Jul 30
3
What is the best method to produce means by categorical factors?
I am attempting to replicate some of my experience from SAS in R and assume there are best methods for using a combination of summary(), subset, and which() to produce a subset of mean values by categorical or ordinal factors. within sas I would write proc means mean data=dataset; class factor1 factor2 var variable1 variable2; RUN; producing an output with means for each variable by factor groupings as below: *factor1 factor2 obs variable mean* Level A treatmentA 3 variable1 10 variable2 22...
2009 Aug 11
3
loadings function (PR#13886)
Full_Name: Mike Ulrich Version: 2.9 OS: Mac OSX Submission from: (NULL) (69.169.178.34) The help documentation for loadings() lists more then one parameter. The function call only expects one parameter. The digits, cutoff, and sort parameters are not used in the function. ## S3 method for class 'loadings': print(x, digits = 3, cutoff = 0.1, sort = FALSE, ...) ## S3 method for class
2008 Jun 16
1
ggplot2: How to remove legend component for geom_errorbar() ?
Dear list (probably Hadley), I'm trying to do a plot like the following, composed of bars and error bars: df <- data.frame(factor1=gl(2,5), factor2=gl(5,1), y=rnorm(10), err=0.1) ggplot(df, aes(x=factor1, y=y, fill=factor2)) + geom_bar(position="dodge", stat="identity") + geom_errorbar(aes(min=y-err, max=y+err), position="dodge", width=0.1) The plot obtained has a legend named "factor2", givin...
2007 Sep 27
2
center option of basehaz in survfit
...asehaz does to factors. (basehaz computes the baseline cumulative hazard for a coxph object using the Breslow estimator). Lets say I'm interested in a survival model with two (dichotomous) factors and a continuous covariate. Variable Possible Values Factor1 0 or 1 Factor2 0 or 1 Covariate 0 to 100 I fit my model: modelname <- coxph(Surv ~ Factor1 + Factor2 + Covariate, data = data) If I then ask for: baselineA <- basehaz(modelname, centered=FALSE) I am fairly certain that baselineA will provide me with the cumulative hazard evaluate...
2009 Mar 31
3
Factor Analysis Output from R and SAS
...0000 0.9473451 #v6 0.4086076 0.4326113 0.4320310 0.4323259 0.9473451 1.0000000 factanal(m1, factors=3) # varimax is the default # Output from R #Call: #factanal(x = m1, factors = 3) #Uniquenesses: # v1 v2 v3 v4 v5 v6 #0.005 0.101 0.005 0.224 0.084 0.005 #Loadings: # Factor1 Factor2 Factor3 #v1 0.944 0.182 0.267 #v2 0.905 0.235 0.159 #v3 0.236 0.210 0.946 #v4 0.180 0.242 0.828 #v5 0.242 0.881 0.286 #v6 0.193 0.959 0.196 # Factor1 Factor2 Factor3 #SS loadings 1.893 1.886 1.797 #Proportion Var 0.316 0.314 0.300 #Cumulative Va...
2009 Dec 03
2
(Grouped + Stacked) Barplot
Hi All, I have googled and tried finding if someone has ever tried producing (Grouped + Stacked) Barplot. I couldn't find one. My data needs to be reshaped, but once it is done it would be something like this: Factor1 Factor2 Factor3 Value A X P 10 A X Q 20 A Y P 20 A Y Q 5 A Z P 20 A Z Q 10 B X P 20 B X Q 10 B Y P 30 B Y Q 50 B Z P 10 B Z Q 20 There are three categorical variables (Factor1, Factor2, and Fa...
2010 Apr 14
1
what is the intercept of a two-way anova model without interaction term?
Dear list, I have a question regarding the meaning of intercept term in a two-way anova model without interaction term. for example (let's assume there is no interaction between factor1 and factor2) : > df         val        factor1 factor2 1  48.61533       A      t1 2 171.13535       B      t1 3  65.96884       C      t1 4  63.71222       A      t2 5  80.22049       B      t2 6  96.95929       C      t2 7  38.70078       A      t3 8  99.44787       B      t3 9  36.58818       C      t3...
2009 Dec 07
2
column statistics
Hi everybody, I would like to compute the mean for 1 variable between the rows with the same levels. For example, with the dataset below: Factor1 Factor2 Value A X 1 A X 2 A Y 3 A Y 4 B X 5 B X 6 B Y 7 B Y 8 I would like to...
2003 Jan 20
1
make check for R-1.6.2 on IBM AIX
...3.cor) Uniquenesses: height arm.span forearm lower.leg weight 0.170 0.107 0.166 0.199 0.089 bitro.diameter chest.girth chest.width 0.364 0.416 0.537 Loadings: Factor1 Factor2 height 0.865 0.287 arm.span 0.927 0.181 forearm 0.895 0.179 lower.leg 0.859 0.252 weight 0.233 0.925 bitro.diameter 0.194 0.774 chest.girth 0.134 0.752 chest.width 0.278 0.621 Factor1 Factor2 SS loadings 3....
2004 Mar 02
1
possible bug in aov?
...2.0944016e+002, 2.9755054e+002, 2.3970708e+002, 2.2379642e+002) sample.df <- data.frame(dep.variable=rawdat, subject=factor(rep(paste("subj",1:6, sep=""),each=9)), factor1=factor(rep(rep(c("fac1level1","fac1level2","fac1level3"),each=6),3)), factor2=factor(rep(c("fac2level1","fac2level2","fac2level3"),each=18)) ) sample.aov <- aov(dep.variable ~ factor1 * factor2 + Error(subject/(factor1+factor2)), data=df) But the aov function returns an error: Error in "names<-.default"(`*tmp*`, value = nmstrat...
2010 Jun 10
0
Help with Post-Hoc tests for TWO-WAY within subject ANOVA
Dear R users, I posted a couple of questions and got no response, so I am giving it another shot. I ran an experiment with a TWO-WAY within subject design. A sample dataset is in http://www-scf.usc.edu/~hex/data.txt I already ran ANOVA by using the following formula: aov(RT~Factor1*Factor2 + Error(Subject/(Factor1*Factor2)), data=data) and I obtained the following information: ------------- Error: Subject Df Sum Sq Mean Sq F value Pr(>F) Residuals 19 6154709 323932 Error: Subject:Factor1 Df Sum Sq Mean Sq F value Pr(>F) Factor1 1...
2009 Nov 17
1
lattice barchart
I have a data frame with two factors and want to create panel barcharts with one factor defining the panels and the other the vertical categories by which I can count the rows of data in each combination of factors. How do I do this? I have been trying to use barchart(~factor1|factor2) but it does not give the panels as I want them. The data looks like this: Factor1 Factor2 A y B y A x B y C x etc... -- View this message in context: http://old.nabble.com/lattice-barchart-tp26387179p26387179.html Sent from the R...