Displaying 16 results from an estimated 16 matches for "fact1".
Did you mean:
fact
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))
has an output that easily fit the A4 page, while the s...
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 <- letters[1:10]
> data.frame(fact1,fact2,fact3)
fact1 fact2 fact3
1 C Z a
2 A Y b
3 A Y c
4 C Z d
5...
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
2004 Aug 12
0
Re: R-help Digest, Vol 18, Issue 12
...message for aov1 was "Estimated effects <may> be unbalanced". The
effects are not unbalanced. The design is 'orthogonal'.
The problem is that there are not enough degrees of freedom to estimate
all those error terms. If you change the model to:
aov1 <-
aov(RT~fact1*fact2*fact3+Error(sub/(fact1+fact2+fact3)),data=myData)
or to
aov2 <-
aov(RT~fact1*fact2*fact3+Error(sub/
((fact1+fact2+fact3)^2)),data=myData)
all is well. This last model (aov2) seems to me to have an excessive
number of error terms.
The lme model lme(RT~fact1*fact2*fact3, random=...
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. These assumptions are easily violated
so I seek refuge in fitting a mixed-effects model with the nlme library.
> lme1 <- lme(resp~fact1*fact2, random=~1...
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, random=~1|subj/(fact1+fact2), data=mydata)
Error in getGroups.data.frame(dataMix, groups):
Inv...
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, bu...
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 that, is there anything else I need to know about
swapping labels between factors in a df?
__________...
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
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
i11 0.745
i12 0.777
i13 0.674
i14 0.644
i15 0.796
* Factor...
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 would like to skip the DF$ for convenience
# so I tried something like this :
tabsub<-deparse(substitute(subset))
dDF...
2008 Feb 20
3
reshaping data frame
Dear all,
I'm having a few problems trying to reshape a data frame. I tried with
reshape{stats} and melt{reshape} but I was missing something. Any help is
very welcome. Please find details below:
#################################
# data in its original shape:
indiv <- rep(c("A","B"),c(10,10))
level.1 <- rpois(20, lambda=3)
covar.1 <- rlnorm(20, 3, 1)
level.2
2005 Dec 01
8
Impaired boxplot functionality - mean instead of median
Hello to all users and wizards.
I am regulary using 'boxplot' function or its analogue - 'bwplot' from
the 'lattice' library. But they are, as far as I understand, totally
flawed in functionality: they miss ability to select what they would
draw 'in the middle' - median, mean. What the box means - standard
error, 90% or something else. What the whiskers mean -
2005 Apr 26
0
Construction of a "mean" contengency table
...factorlist, FUN, condition)
## DF is the original dataframe with raw results from my experiments
## var is the var that I want to print
## eg. DF$var1
## factorlist is a list of the two factor I want to mean against (but
I'm noot sure List is the best form for this argument),
## eg. list(DF$fact1, DF$fact2)
## FUN would be the function I want to use during aggregation,
## eg. Mean( )
## condition would be a condition for building a subset
## eg. DF$fact3==1
{
sDF <- subset(DF, condition)
A <- aggregate(sDF, factorlist, FUN)
M <- matrix(data=NA, nrow = length(levels(factorlist...
2003 Jan 27
1
survival bug? (PR#2499)
...AAAAAAAAAAAAAA
--Apple-Mail-28-953181987--
--Apple-Mail-27-953181986
Content-Disposition: attachment;
filename=bug.txt
Content-Transfer-Encoding: quoted-printable
Content-Type: text/tab-separated-values;
x-mac-creator=5843454C;
x-unix-mode=0644;
x-mac-type=54455854;
name="bug.txt"
fact1 fact2 covar time delta=0D57 1 71 100 =
0=0D24 27 73 100 0=0D54 42 74 46 1=0D24 =
27 77 100 0=0D60 42 78 100 0=0D33 1 =
78 100 0=0D60 42 79 100 0=0D54 42 79 =
100 0=0D24 1 79 100 0=0D48 27 80 78 =
1=0D54 1 80 100 0=0D54 42 81 34 1=0D24 =
27 81 48 1=0D24 1 81 100 0=0D48 40 =
81 100 0=0D58 1 82 13 1=0...