search for: sitenew

Displaying 3 results from an estimated 3 matches for "sitenew".

Did you mean: sitenet
2007 May 04
0
Predicted Cox survival curves - factor coding problems...
...s for a particular covariate profile. The main purpose of the plot will be to visualise the effect of snp1, coded 0 and 1. In my Cox model I have stratified by one variable, edu, and so I know I will automatically get a separate curve for each strata. My problem is how to deal with the variable sitenew, which is a 3 level factor (coded 0,1,2). coxsnps$edu <- as.factor(coxsnps$edu) coxsnps$sitenew <- as.factor(coxsnps$sitenew) test1 <- coxph(Surv(time,censor) ~ snp1 + sex + sitenew + geno + eth_self + strata(edu), data=coxsnps) coef exp(coef) se(coef) z...
2007 May 07
1
Predicted Cox survival curves - factor coding problems..
The combination of survfit, coxph, and factors is getting confused. It is not smart enough to match a new data frame that contains a numeric for sitenew to a fit that contained that variable as a factor. (Perhaps it should be smart enough to at least die gracefully -- but it's not). The simple solution is to not use factors. site1 <- 1*(coxsnps$sitenew==1) site2 <- 1*(coxsnps$sitenew==2) test1 <- coxph(Surv(time, censor) ~ snp...
2010 Mar 15
1
Assigning a sequence to a subsetted data frame variable
Hey folks, I have a difficult (at least for me) problem that I was hoping one of you may know how to solve. I want to assign a sequence to subsets of a variable in a data frame based on date. The variable is 'SITE1' and the date is a unique day (DD) and month (MM) combination. The sequence contains site numbers 101:104, and each day-month combination takes four site numbers from that