search for: releveling

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

Did you mean: relabeling
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
...at I try to achieve: > df <- data.frame(cbind(c("a","b","c","d","e"), c(5,6,4,8,9))) > colnames(df) <- c("name", "value") > df name value 1 a 5 2 b 6 3 c 4 4 d 8 5 e 9 Now the releveling: df$name <- factor(df$name, levels=c("b","d","c","e","a")) That was easy. But the plotting goes wrong when the data.frame has less rows: > df name value 1 a 5 4 d 8 5 e 9 Now my script runs the same line again: df$nam...
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
Hi All, I'm perplexed by the way the unclass function displays a factor whose labels have been swapped with the relevel function. I realize it won't affect any results and that the relevel did nothing useful in this particular case. I'm just doing it to learn ways to manipulate factors. The display of unclass leaves me feeling that the relevel had failed. I've checked three books
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
I was surprised to find that just changing the base level of a factor variable changed the number of significant coefficients in the solution. I was surprised at this and want to know how I should choose the order of the factors, if the order affects the result. Here is the small example. It is taken from 'The R Book', Crawley p. 365. The data is at
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