[R] Fixing the coefficient of a regressor in formula
Marie-Pierre Sylvestre
marie-pierre.sylvestre at mail.mcgill.ca
Wed May 28 16:52:38 CEST 2008
Dear R users,
I want to estimate a Cox PH model with time-dependent covariates so I am
using a counting process format with the following formula:
Surv(data$start, data$stop, data$event.time) ~ cluster(data$id) + G1 +
G2 + G3 + G4 + G5 +G6
Gs represent a B-spline basis functions so they sum to 1 and I can't
estimate the model as is without getting the last coefficient to be NA,
which makes sense given the perfect collinearity.
without getting in lengthy details about my code, let me just say that
to avoid the colinearity problem,. I do not want to omit G1 from the
regression. Instead, I want to fix the regression coefficient of one of
the regressors, G1, to 1.
I have read the R manual section on formulae but I have not found how to
do fix a regression coefficient. Conceptually speaking it seems to me
that it should be simple, and I am sure that someone explained it
somewhere, but I did not find the proper keywords to find it!
So, does someone know how to fix the coefficient of a regressor in the
formula for Cox model so that the coefficient is not estimated but still
taken into account?
Thank you in advance,
MP
More information about the R-help
mailing list