search for: factor

Displaying 20 results from an estimated 17844 matches for "factor".

2007 Jan 29
8
x86_64 build break in rombios
...c > _rombios_.c bcc -o rombios.s -C-c -D__i86__ -0 -S _rombios_.c sed -e ''s/^\.text//'' -e ''s/^\.data//'' rombios.s > _rombios_.s as86 _rombios_.s -b tmp.bin -u- -w- -g -0 -j -O -l rombios.txt +a A311 BB 0000 mov bx, # ***** factor expected.....................................^ +a A317 BB 0000 mov bx, # ***** factor expected.....................................^ +a A31D BB 0000 mov bx, # ***** factor expected.....................................^ +a A323...
2011 Nov 08
2
why NA coefficients
Hi, I am trying to run ANOVA with an interaction term on 2 factors (treat has 7 levels, group has 2 levels). I found the coefficient for the last interaction term is always 0, see attached dataset and the code below: > test<-read.table("test.txt",sep='\t',header=T,row.names=NULL) > lm(y~factor(treat)*factor(group),test) Call: lm(formu...
2009 Feb 12
2
repost: problems with lm for nested fixed-factor Anova (ANOVA I)
Dear R users, I have posted this question several days ago and received not a single suggestion. I believe I have provided sufficient information for at least some help. Here I repost the question with several modifications. I want to run nested fixed-factor Anova in R on different experiments. I have 48 levels of the main factor x1 and 242 levels of the nested factor z1, and continuous response variable y1 with around 15.000 data points. There is no interaction between specification of the main factor and nested factor levels. When I run lm on using...
2010 Feb 04
4
Why is there no c.factor?
Hi all, Is there are reason that there is no c.factor method? Analogous to c.Date, I'd expect something like the following to be useful: c.factor <- function(...) { factors <- list(...) levels <- unique(unlist(lapply(factors, levels))) char <- unlist(lapply(factors, as.character)) factor(char, levels = levels) } c(factor(&q...
2000 May 02
3
Possible bug in factor (PR#531)
The expressions > x<-factor(x) and > class(x)<-"factor" behave differently when x is already an ordered factor. It may not be a bug but it caught me out when I was trying to remove the "orderedness" from a factor variable. The following R code illustrates the difference. Is this difference betwee...
2012 Nov 12
5
Matrix to data frame conversion
...t again. Why did I fail in the attempt and how can I achieve what I wanted without this roundabouts? The original matrix: > str(comb_model0) num [1:90, 1:4] 3.5938 0.0274 0.0342 0.0135 0.0207 ... - attr(*, "dimnames")=List of 2 ..$ : chr [1:90] "(Intercept)" "as.factor(dow)1" "as.factor(dow)2" "as.factor(dow)3" ... ..$ : chr [1:4] "Estimate" "Std. Error" "t value" "Pr(>|t|)" > dim(comb_model0) [1] 90 4 > class(comb_model0) [1] "matrix" > > > head(comb_model0,10)...
2010 Jan 13
0
need a clarification on logistic regression
hello I need a clarification. in logistic regression, saturated model having all combinations and interactions of variables should be constructed in this way ? : > rsat2=glm(cbind(landp,landa) ~ as.factor(rlito)*as.factor(rslp)*as.factor(rasp)*as.factor(rplc)*as.factor(rwi),family= binomial(link=logit),data=rdf46) then using stepAIC to eliminate some models having high AIC values. > stpAIC_r2=stepAIC(rsat2,list(lower=~1,upper=formula(rsat2)),trace=F) But obtained final model looks very intri...
2012 Aug 07
0
predicting test dataset response from training dataset with randomForest
...K V K L L V L L C T F T A T Y A ... suscep 2 M K V K L L V L L C T F A A T Y A ... suscep 3 M K V K L L V L L C T F T A T Y A ... resist ... > # some of the important sites identified by fisher test > dat1$X13 <- as.factor(dat1$X13) > dat1$X52 <- as.factor(dat1$X52) > dat1$X53 <- as.factor(dat1$X53) > dat1$X64 <- as.factor(dat1$X64) > dat1$X85 <- as.factor(dat1$X85) > dat1$X99 <- as.factor(dat1$X99) > dat1$X111 <- as.factor(dat1$X111) > dat1$X142 <- as.factor(dat1$X142) >...
2011 Apr 20
3
Make as.factor an S3 generic?
as.factor / as.ordered is not written as a generic. This differs from as.numeric, as.matrix, and other as.*. The following seems to address this and does not break make check-all. FWIW, the patch is against r55563, because with r55564 I see /home/mtmorgan/src/R-devel/src/main/dounzip.c:75:15: error: stor...
2009 Aug 20
1
Questions on factors in regression analysis
I got two questions on factors in regression: Q1. In a table, there a few categorical/factor variables, a few numerical variables and the response variable is numeric. Some factors are important but others not. How to determine which categorical variables are significant to the response variable? Q2. As we knew, lm can deal w...
2009 Feb 09
0
problems with lm for nested fixed-factor Anova
Dear R users, I want to run nested fixed-factor Anova in R on different experiments. In this toy example I have 3 levels of the main factor x1 and 7 levels of the nested factor z1 x1 and continuous response variable y1. x1 [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 [38] 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3...
2012 Jun 27
1
If statement - copying a factor variable to a new variable
I need to look through a dataset with two factor variables, and depending on certain criteria, create a new variable containing the data from one of those other variables. The problem is, R keeps making my new variable an integer and saving the data as a 1 or 2 (I believe the levels of the factor). I've tried using as.factor in the IF outpu...
2006 Mar 20
1
type in daisy
...asetraits) pdias=as.numeric(pdias) longindex=as.numeric(longindex) light=as.numeric(light) humid=as.numeric(humid) basic=as.numeric(basic) azot=as.numeric(azot) durflow=as.numeric(durflow) height=as.ordered(height) spread=as.ordered(spread) begflow=as.ordered(begflow) mycor=as.ordered(mycor) piq=as.factor(piq) lign=as.factor(lign) grain=as.factor(grain) ros=as.factor(ros) semiros=as.factor(semiros) leafy=as.factor(leafy) autopoll=as.factor(autopoll) geito=as.factor(geito) insect=as.factor(insect) wind=as.factor(wind) suman=as.factor(suman) winan=as.factor(winan) monocarp=as.factor(monocarp) polycarp...
2016 Apr 19
0
Indicator Species analysis; trouble with multipatt
Hi Ansely, As Jim points out we really need some sample data to go with the code. Have a look at ?dput which is the best way to supply sample data here or have a look at http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and/or http://adv-r.had.co.nz/Reproducibility.html for some general suggestions on asking questions here---including discussions of using
2011 Nov 20
3
logistic regression by glm
HI I use glm in R to do logistic regression. and treat both response and predictor as factor In my first try: ******************************************************************************* Call: glm(formula = as.factor(diagnostic) ~ as.factor(7161521) + as.factor(2281517), family = binomial()) Deviance Residuals: Min 1Q Median 3Q Max -1.5370 -1.0431 -0.9416 1.3065 1.4331 Coefficien...
2005 Nov 27
5
creating a factor from other factors and ifelse
Hi, Given > sec98 <- factor(rep(1:2,3), labels=c("A", "B")) > sec99 <- factor(rep(2:1,3), labels=c("A", "B")) > sec99[c(2,5)] <- NA > sec00 <- factor( c( rep(1,3), rep(2,3) ), labels=c("A", "B")) > sec00[c(2,4)] <- NA > sec1 <- ife...
2010 Oct 13
5
Poisson Regression
Hello everyone, I wanted to ask if there is an R-package to fit the following Poisson regression model log(\lambda_{ijk}) = \phi_{i} + \alpha_{j} + \beta_{k} i=1,\cdots,N (subjects) j=0,1 (two levels) k=0,1 (two levels) treating the \phi_{i} as nuinsance parameters. Thank you very much -- -Tony [[alternative HTML version deleted]]
2016 May 30
1
factor(x, exclude=NULL) for factor x; names in as.factor(<integer>)
In R 3.3.0 (also in R 2.7.2), the documentation on 'factor', in "Details" section, has this statement. 'factor(x, exclude = NULL)' applied to a factor is a no-operation unless there are unused levels: in that case, a factor with the reduced level set is returned. It is not true for a factor 'x' that has NA. In that case, if l...
2010 Jan 20
5
standardizing one variable by dividing each value by the mean - but within levels of a factor
Hello! I have a data frame with a factor and a numeric variable: x<-data.frame(factor=c("b","b","d","d","e","e"),values=c(1,2,10,20,100,200)) For each level of "factor" - I would like to divide each value of "values" by the mean of "values" that...
2010 Feb 12
1
aggregate: with 2 by variables in the result the 2nd by-variable is wrong (PR#14213)
...t columns of the result contain these combinations of levels. With two by variables the second by-variable takes always only one value. However, it works fine with one or three by-variables. The problems seems to be caused by this line of code in aggregate(): w <- as.data.frame(w, stringsAsFactors = FALSE)[which(!unlist(lapply(z, is.null))), , drop = FALSE] or more specifically by: [which(!unlist(lapply(z, is.null))), , drop = FALSE] Kind regards FQ # demonstration of the aggregate bug ind R 2.10.1 factor.a=rep(letters[1:3],4) factor.b=rep(letters[4:5],each=3,times=2) factor.c=re...