Expressing a hazard function with a Cox proportional hazards model I'm trying to wrap my head around Cox models as well as how to express them in the form of hazard functions when you have both categorical AND numeric covariates.  I need some assistance with this question below.
In a study, the following covariates were collected on a number of subjects.
• z1: Treatment status: 0 if control, 1 if treatment
• z2: Sex: 0 if male, 1 if female
• z3: Age in years
• z4: Height in inches
A Cox proportional hazards model will be constructed to estimate the effect of treatment on the hazard. It is thought that the effect of treatment may be different for men and women. It is further thought that hazard increases with age, but that the effect of treatment does not vary with age. However, the treatment group is slightly older, on the average, than the control group. It is not thought that the hazard function varies with height, but the control group is slightly taller, on average, than the treatment group, and men are somewhat taller, on average, than women. 
Express the hazard in terms of the covariates and parameters.
How do you express the hazard in the form below when you have so many different covariates? I know that I need to include the baseline hazard but I'm unsure has to how many beta parameters I need, or what covariates need to be multiplied by those beta parameters.

 A: This question apparently expects you to include all predictors that are reasonably related to hazard into the Cox model.
Remember that the inner product ${\bf z}^T {\bf \beta}$ between predictors and their corresponding coefficients (called the linear predictor) can also be written in the form:
$$ \sum_{i=1}^p \beta_i z_i$$
where $z_i$ is a predictor, $\beta_i$ is its corresponding regression coefficient, and $p$ is the total number of predictors. So there is no problem in including multiple predictors in your model, including interactions among your covariates as predictors, and so on. Just add more predictors on to that sum.* 
This isn't really different from the situation in a standard linear regression, except that in a linear regression you usually include the intercept in the linear predictor. The baseline hazard $\lambda_0(t)$ takes the place of an intercept in a Cox regression, which you perhaps can see better by taking the logarithm of your equation for the hazard:
$$\log\lambda_{\bf z}(t) = \log\lambda_0(t) + {\bf z}^T{\bf \beta}.$$
With respect to continuous versus categorical predictors, think about what happens with a continuous predictor when it has a value of 0 versus when it has a value of 1. If a continuous predictor $z_i$ has a value of 0 it will add 0 to the linear predictor. If $z_i$ has a value of 1, it will add $\beta_i$ to the linear predictor.
Is there anything different from this if you instead have a 2-level categorical covariate $z_j$, with one level coded as 0 and the other as 1? At the reference level (coded 0) it adds nothing to the linear predictor, and at the other level (coded 1) it adds $\beta_j$.**
Try putting that information together into your answer. Your decision then is which of your covariates are expected to be associated with hazard and thus should be included in your model. You also should think about whether you might need to add any interactions between covariates as predictors, as you would if the effect of one predictor depends on the value of another predictor. (Note that including an interaction can provide a test of assumptions like "the effect of treatment does not vary with age.")

*In practice you can overfit a model if the ratio of cases to predictors is too small, but that doesn't seem to be an issue here.
**Things get a bit trickier if a categorical covariate has more than 2 levels; then you have to add an additional predictor to the model for each level beyond the second.
A: So here's what I came up with....
$\lambda_z(t)= \lambda_0(t) \exp(\beta_1z_1 + \beta_{_2}z_{_2} + \beta_{_3}z_{_3} + \beta_{_4}z_{_1}z_{_2} + \beta_{_5}z_{_1}z_{_3} + \beta_{_6}z_{_1}z_{_4} + \beta_{_7}z_{_2}z_{_4})$ 
I believe that I've accounted for every single condition and interaction between covariates accounted for in the paragraph below.
It is thought that the effect of treatment may be different for men and women. It is further thought that hazard increases with age, but that the effect of treatment does not vary with age. However, the treatment group is slightly older, on the average, than the control group. It is not thought that the hazard function varies with height, but the control group is slightly taller, on average, than the treatment group, and men are somewhat taller, on average, than women.
I'm still unsure as to whether I've listed my interactions correctly but this is a start. 


*

*Age ($z_{_3}$) was believed to affect the hazard so its included with its own beta parameter and is also used as an interaction on $\beta_{_5}$ with  treatment due to the treatment group being older than the control group.

*Height ($z_{_4}$) was believed to not affect the hazard by itself so I've left it out but I included it in an interaction with    treatment($z_{_1}$) and sex ($z_{_2}$) on $\beta_{_6} $ and $\beta_{_7}$ respectively... 
