Displaying 20 results from an estimated 4000 matches similar to: "dropping factor levels in subset"
2007 Dec 09
2
adjusting "levels" after subset a table
Um texto embutido e sem conjunto de caracteres especificado associado...
Nome: n?o dispon?vel
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20071208/5409f1a7/attachment.pl
2011 Apr 07
1
Assigning a larger number of levels to a factor that has fewer levels
Hello!
I have larger and a smaller data frame with 1 factor in each - it's
the same factor:
large.frame<-data.frame(myfactor=LETTERS[1:10])
small.frame<-data.frame(myfactor=LETTERS[c(9,7,5,3,1)])
levels(large.frame$myfactor)
levels(small.frame$myfactor)
table(large.frame$myfactor)
table(small.frame$myfactor)
myfactor has 10 levels in large.frame and 5 levels in small.frame. All
5
2009 May 06
4
tapply changing order of factor levels?
Hi,
Does tapply change the order when applied on a factor? Below is the code I
tried.
> mylevels<-c("IN0020020155","IN0019800021","IN0020020064")
>
2003 Mar 03
1
transition matrix problem
I'm having trouble using some fairly simple code to change the entries
in a vector (x - the numbers 0-5) according to a simple transition
matrix that I've called p.dry.
the error message I get is
"no finite arguments to min; returning Inf"
Any suggestions as to where I'm going wrong greatly appreciated. Sorry
the message is lengthy!
cheers
Nick
The code is
2003 Jun 27
1
R-help Digest, Vol 4, Issue 27 ( -Reply)
Hi,
I am out of town and will get back to you on the 13th of July.
Leo
>>> "r-help at stat.math.ethz.ch" 06/27/03 00:32 >>>
Send R-help mailing list submissions to
r-help at stat.math.ethz.ch
To subscribe or unsubscribe via the World Wide Web, visit
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
or, via email, send a message with subject or body
2012 Jan 18
1
drop rare factors
I have a data frame with some factor columns.
I want to drop the rows with rare factor values
(and remove the factor values from the factors).
E.g., frame$MyFactor takes values
A 1,000 times,
B 2,000 times,
C 30 times and
D 4 times.
I want to remove all rows which assume rare values (<1%), i.e., C and D.
i.e.,
frame <- frame[[! (frame$MyFactor %in% c("A","B"))]]
except
2002 Jan 16
2
exhaustive permutations
Hello R-help Readers
I'm currently in the process of trying to write a permutation test
procedure for looking at differences between groups with a multivariate
data set (something equivalent to ANOSIM - analaysis of similarities for
those familiar with this test). As with other permutation tests, for
cases where there are large numbers of possible permutations, randomly
sampling from these
2010 Jul 05
2
repeated measures with missing data
Dear R help group, I am teaching myself linear mixed models with missing data since I would like to analyze a stats design with these kind of models. The textbook example is for the procedure "proc MIXED" in SAS, but I would like to know if there is an equivalent in R. This example only includes two time-measurements across subjects (a t-test "with missing values"), but I
2012 Mar 28
1
discrepancy between paired t test and glht on lme models
Hi folks,
I am working with repeated measures data and I ran into issues where the
paired t-test results did not match those obtained by employing glht()
contrasts on a lme model. While the lme model itself appears to be fine,
there seems to be some discrepancy with using glht() on the lme model
(unless I am missing something here). I was wondering if someone could
help identify the issue. On
2012 Nov 24
1
Adding a new variable to each element of a list
Hello,
I have a list of data with multiple elements, and each element in the list
has multiple variables in it. Here's an example:
### Make the fake data
dv <- c(1,3,4,2,2,3,2,5,6,3,4,4,3,5,6)
subject <- factor(c("s1","s1","s1","s2","s2","s2","s3","s3","s3",
2004 Aug 17
2
levels of factor
R-help,
I have a data frame wich I subset like :
a <- subset(df,df$"column2" %in% c("factor1","factor2") & df$"column2"==1)
But when I type levels(a$"column2") I still get the same levels as in df (my original data frame)
Why is that?
Is it right?
Luis
Luis Ridao Cruz
Fiskiranns??knarstovan
N??at??n 1
P.O. Box 3051
FR-110 T??rshavn
2006 Apr 29
1
splitting and saving a large dataframe
Hi,
I searched for this in the mailing list, but found no results.
I have a large dataframe ( dim(mydata)= 1297059 16, object.size(mydata=
145280576) ) , and I want to perform some calculations which can be done by
a factor's levels, say, mydata$myfactor. So what I want is to split this
dataframe into nlevels(mydata$myfactor) = 80 levels. But I must do this
efficiently, that is, I
2008 Mar 05
3
ipf function in R
Hi
I have a 3 x 2 contingency table:
10 20
30 40
50 60
I want to update the frequencies to new marginal totals:
100 130
40 80 110
I want to use the ipf (iterative proportional fitting) function which
is apparently in the cat package.
Can somebody please advice me how to input this data and invoke ipf in R
to obtain an updated contingency table?
Thanks.
By the way I am quite new to R.
--
Dr
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
2002 Nov 29
2
Obtaining the variable names of a glm object
Is names(model1$coef) what you're looking 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:
2012 Nov 21
0
BiodiversityR and box cox transformation
Hi all:
I am trying to use the BiodiversityR package in Rcommander since I need to
box-cox transform some data. However, even when trying with the example
files, I get this error just after selecting the box cox transformation in
the Menu, and Rcommander and Rstudio just shut down. What is it? What
could I do? Thanks a lot
The instruction at "0x00000001" referenced memory at
2004 Nov 04
1
requirements for a GPL
Can I get some advice on what is required to claim a GPL for a package?
A package I maintain (pcurve) uses some S code from statlib. I have an
email from the author of the S code saying that he would be happy to
issue a GPL for the code. Is the email from the author enough, or do I
need something more formal?
Chris
--
Chris Walsh
CRC for Freshwater Ecology
Water Studies Centre
PO Box 23
1999 Aug 24
1
Totalnet
We have used the Syntax TotalaNET product (TAS) for some years. This
provides similar funtionality to Samba. However the current version (5.2)
does not support Win98 and the upgrade cost is very high.
In looking at Samba as an alternative, I have two questions:
1. Does Samba fully support Win98?
2. Our users move easily between PCs, X-terminals and workstations,
depending on their
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?
2011 Mar 30
2
summing values by week - based on daily dates - but with some dates missing
Dear everybody,
I have the following challenge. I have a data set with 2 subgroups,
dates (days), and corresponding values (see example code below).
Within each subgroup: I need to aggregate (sum) the values by week -
for weeks that start on a Monday (for example, 2008-12-29 was a
Monday).
I find it difficult because I have missing dates in my data - so that
sometimes I don't even have the