search for: xfac

Displaying 4 results from an estimated 4 matches for "xfac".

Did you mean: fac
2012 Jan 06
1
lme model specification problem (Error in MEEM...)
...als 12 21.176 1.765 # ... rest of output removed ... I understand I can to some extent work around this limitation by modifying the contrast encoding, but I then still don't get an overall test for "as.factor(x)" (in the example above, a test for deviation from linearity). d$xfac <- factor(d$x) contrasts(d$xfac)<-c(1,2,4,6) summary(lme(y~xfac,random=~1|subj,data=d)) Is there a way to work around this limitation of lme? Or do I mis-specify the model? Thanks for your advice. Pascal
2001 Nov 21
2
distances from points to line
Dear all, I have discovered that there are many things that I used to do in my GIS which are easily done directly in R, for example calculating interpoint distances using geoR and pick out points inside a polygon using splancs. I now wonder, is there a function to create a line object like a watercourse and then calculate the distances between many points in space and this line? I couldn't
2011 Jun 14
1
Expand DF with all levels of a variable
...ould like to expand a DF with all the missing levels of a variable. a <- c(2,2,3,4,5,6,7,8,9) a.cut <- cut(a, breaks=c(0,2,6,9,12), right=FALSE ) (x <- data.frame(a, a.cut)) # In 'x' the level "[0,2)" is "missing". AddMissingLevel <- function(xdf) { xfac <- factor( c("[0,2)", "[2,6)", "[6,9)", "[9,12)") ) xlevels <- levels(xfac) if(length(xlevels) != nlevels(factor(xdf$a.cut))) { v <- setdiff(xlevels, factor(xdf$a.cut)) u <- data.frame(a = 0, a.cut = v) x <- r...
2012 Feb 08
2
need help with understanding coxph encoding
Hi, in coxph, coxph(Surv(time, status)~x,data=alm). How to encode x? For example, if x has two groups, the treatment group and control group. if I encode them as 1 and 2. Is the HR results treatment/control? What if I encode them as 0 and 1. I am confused with how survival package works for HR. What should I do to get a treatment/control HR? Thank you. -- View this message in context: