search for: releveled

Displaying 20 results from an estimated 95 matches for "releveled".

Did you mean: relabeled
2010 Aug 03
1
releveling a numeric by factor interaction
Can anyone help me with the necessary code to relevel a numeric*factor interaction term in a linear model? I would like to report the estimate, std. error and t-value for the reference factor. First, I estimated a linear model with dummy variables and was able to retrieve model estimates for the reference factor using relevel. for example: > summary(update(mod.mod, . ~ . - dummy + +
2009 Jan 09
2
recursive relevel
Dear list, I'm having second thoughts after solving a very trivial problem: I want to extend the relevel() function to reorder an arbitrary number of levels of a factor in one go. I could not find a trivial way of using the code obtained by getS3method("relevel","factor"). Instead, I thought of solving the problem in a recursive manner (possibly after reading
2004 Dec 22
0
relevel expansion suggestion
To the R developers, The discussion below reminded me that I think it might be a good idea to take the Relevel function from the Lexis package and replace relevel in stats with it. This is really nothing special for epidemiology. It is fully compatible with the existing relevel (it actually contains the relevel code almost verbatim as a subset), but it has the extra functionality of combining
2017 Oct 28
2
Function Relevel DOE NOT FOUND
Dear Forum, Which functions and packages should be installed to make work the function "relevel"? treatment<-revel(treatment,ref="Db") Error: no se pudo encontrar la funci?n "revel" Thank you very much for your help, Xavier Chiriboga M. PhD Candidate Fundamental and Applied Research in Chemical Ecology Lab. Institute of Biology University of Neuchatel
2017 Oct 28
2
HELP relevel INTERCEPT-COMPARISONS
Dear colleagues, How can I do to "relevel" the intercept? I need that the treatment "Db" be the intercept, and have p-values for the comparisons with the others treatments. I used the function "relevel" but it did not work out to have what I want. Thanks for your help, Xavier T1 <- read.table(file.choose(), h=T) > head(T1) treatment replicate Time
2012 Jan 16
2
Relevel dynamically
Dear list, I am running R code which produces a data.frame with variable rows. For plotting purposes I need to relevel the column called "names" but since the dimension of the data.frame can vary I do not know how to dynamically revel the data.frame. Here is an example data.frame called df to illustrate what I try to achieve: > df <-
2018 Oct 02
1
Relevel confusing with numeric value
Something that bit me: The function relevel takes a factor, and a reference level to be promoted to the first place. If ?ref? is a character this level is promoted, if it?s a numeric the ?ref?-th level is promoted. Which turns out to be very confusing if you have factor with numeric values (e.g. when reading in a csv with some dirty numeric columns and stringsAsFactors TRUE) For example:
2006 Dec 15
1
Switching labels on a factor
...er,q1,q2,q3,q4 1,1,f,1,1,5,1 2,2,f,2,1,4,1 3,1,f,2,2,4,3 4,2,f,3,1, ,3 5,1,m,4,5,2,4 6,2,m,5,4,5,5 7,1,m,5,3,4,4 8,2,m,4,5,5,9") mydata<-read.table(textConnection(mystring), header=TRUE,sep=",",row.names="id",na.strings="9") mydata # Create a gender Releveled variable, gR. # Now 1=m, 2=f mydata$gR <- relevel(mydata$gender, "m") # Print the data to show that the labels of gR match those of gender. mydata # Show that the underlying codes have indeed reversed. as.numeric(mydata$gender) as.numeric(mydata$gR) # Unclass the two variables to s...
2017 Jul 05
2
Svyglm Error
Greetings, I am revisiting code from several different files I have saved from the past and all used to run flawlessly; now when I run any of the svyglm related functions, I am coming up with an error: Error in model.frame.default(formula = F3ATTAINB ~ F1PARED, data = data, : the ... list does not contain 4 elements The following is a minimal reproducible example: library(RCurl)
2013 Jan 16
1
equivalent code that doesn't return same results?
I need to automate changing the reference value for factors in analysis, and it is my understanding that the following two sets of code should produce identical results, but they do not: 1)dataset$method 2)eval(parse(text=paste("dataset",IVcat[k],sep="$"))) (in this case I have IVcat[k]=method, which is why they are equal) I even tested them in R, which says that these
2017 Jul 05
0
Svyglm Error
hi, i am not hitting an error when i copy and paste your code into a fresh console. maybe compare your sessionInfo() to mine? > sessionInfo() R version 3.4.1 (2017-06-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows Server 2008 R2 x64 (build 7601) Service Pack 1 Matrix products: default locale: [1] LC_COLLATE=English_United States.1252
2010 Aug 03
0
releveling a numeric by factor interaction in a lm
How can I relevel a liner model with a numeric by dummy variable interaction to extract the model estimate, std. error, and t-value for the reference factor? Thank you, Christy [[alternative HTML version deleted]]
2010 Mar 25
3
Returning Data Frame from Function for use Outside Function
I have a function (see below) that does some bootstrapping (I am happy to expand offline why I could use existing functions.) I put my results into and empty matrix and add a row of results with each iteration. My problem is i am a new user to R and I don't understand data frames, matrices, elements, and vectors well. What I would like is to have a data frame I can manipulate outside of the
2011 Jan 10
1
debug biglm response error on bigglm model
G'morning What does the error message "Error in x %*% coef(object) : non- conformable arguments" indicate when calculating the response values for newdata with a model from bigglm (in package biglm), and how can I debug it? I am attempting to do Monte Carlo simulations, which may explain the loop in the code that follows. After the code I have included the output, which shows that
2004 Dec 22
4
ordering levels
Hello! I would like to know if there is a simple way to reorder levels of a given factor.Let's say that the vector testf<-factor(c("red","red","red","blue","blue","white")) levels(testf) : blue red white should have reordered levels such as levels(testf) : red blue white (this is for presentation purposes) I guess
2012 Feb 03
1
ordering of factor levels in regression changes result
...l (comp$clipping, ref="n25") > summary(comp) biomass clipping Min. :415.0 n25 :6 1st Qu.:508.8 control:6 Median :568.0 n50 :6 Mean :561.8 r10 :6 3rd Qu.:631.8 r5 :6 Max. :731.0 Redo LM with releveled data > modelRelev<-lm(biomass~clipping, data=comp) Different results. (Some parts, Residuals and Std Errors, are the same) Especially note the Pr and Signifcance columns are different. > summary(modelRelev) Call: lm(formula = biomass ~ clipping, data = comp) Residuals:...
2004 May 03
1
Setting up contrasts
I am using the following model: lm <- lm(mydata[[variableName]] ~ Age + Gender + Group, data=mydata) There are 5 groups in "Group": nonc (the control), c1,c2,c3 and c4. How do I contrast nonc vs the others? and How do I contrast c1 vs other c's (ie c2,c3,c4 as a subgroup)? I have looked at the contrasts option in lm and model.matrix and am really none the wiser. Though it
2004 Dec 22
0
ordering levels: I was wrong
I was wrong about needing the Relevel from the Lexis package. The default verson of relevel does the job of reshuffling levels in any desired order, albeit with a warning (which comes from the fact that apparently only a single number had been anticipated by the designer): > testf <- factor( sample( letters[1:4], 100, replace=T ) ) > table( testf, newf=relevel( testf, ref=c(3,2,1,4) )
2010 Jul 07
6
forcing a zero level in contr.sum
I need to use contr.sum and observe that some levels are not statistically different from the overall mean of zero. What is the proper way of forcing the zero estimate? It seems the column corresponding to that level should become a column of zeros. Is there a way to achieve that without me constructing the design matrix? Thank you. Stephen Bond [[alternative HTML version deleted]]
2010 Nov 08
1
R help: reorder columns in an xyplot
Hello. First post, though I have read scores. Mostly i can solve my problems reading the archives, but I lack the vocabulary to ask this one right. Any social faux pais, I apologize. I am sure this is a very basic question and I am embarrassed to ask, but I spent several hours scouring the archives and trying various suggestions, but I am too new to get any of them to work. I am trying to