vasupify.blogg.se

Interaction term stata 12
Interaction term stata 12






  1. #Interaction term stata 12 how to
  2. #Interaction term stata 12 code

That is, there is evidence that the effect of sex is not the same for the four subsites. The likelihood ratio test ( lrtest command) suggests there is some evidence of an interaction (p=0.06). The interaction model therfore has 3 additional parameters.

interaction term stata 12

In the main effects model we estimated one hazard ratio for the effect of sex, whereas we are now estimating four hazard ratios (one for each subsite). 9183786 1.023922īefore attempting to interpret the estimates, we will test the statistical significance of the interaction effect. stcox i.sex#i.subsite i.agegrp i.stage yearspl* We will start by using the default parameterisation of interaction effects. Interaction model (default parameterisation) We are now allowing the effect of sex to differ for each subsite, but the estimates are assumed the same for each combination of age group, stage, and year of diagnosis and at each point in the follow-up. We will now partially relax that assumption, by fitting an interaction between sex and subsite. This estimate is assumed to apply for every point in follow-up (i.e., proportional hazards) and for every combination of subsite, age group, stage, and year of diagnosis. The estimated hazard ratio for sex is 0.749, indicating that females experience 25% lower cause-specific mortality than males. of subjects = 6,144 Number of obs = 6,144 stcox i.sex i.subsite i.agegrp i.stage yearspl*Ĭox regression - Breslow method for ties We’ll start by fitting a main effects model. stset surv_mm, fail(status=1) scale(12) exit(time 120) cause-specific survival (status=1 is death due to melanoma) Variables yearspl1 to yearspl3 were created spline variables for year of diagnosis (Skin melanoma, diagnosed 1975-94, follow-up to 1995) We stset with death due to melanoma as the outcome (i.e., we will model cause-specific mortality). We read the data, excluding patients with stage=0 (unknown), create the spline basis variables for year of diagnosis, and illustrate the coding of the exposure variable ( sex) and modifier ( subsite). This specifies that base levels of factor variables are reported in coefficient tables. We recommend setting the following option (which can be set permanently). We highly recommend looking at the help file.

interaction term stata 12 interaction term stata 12

Stata has a rich framework for working with factor variables, although fvvarlist is not a term one would naturally search for. The focus of this tutorial is on illustrating statistical concepts and data analysis in Stata, not a scientific study of sex differences in survival. We will adjust for stage (in categories) and year of diagnosis (as a restricted cubic spline) but our model is much simpler than what would be required for a rigorous scientific study of sex differences in patient survival. In epidemiological language, subsite is the modifier and we are interested in estimating the effect of sex for each level of the modifier. That is, we will fit an interaction between sex and subsite. We will investigate whether the effect of sex is modified by anatomical subsite. In epidemiological language, sex is the exposure and we call the estimated hazard ratio the ‘effect of sex’. We will study survival of patients diagnosed with melanoma, focusing on differences in survival between males and females.

#Interaction term stata 12 how to

This tutorial illustrates Stata factor variable notation with a focus on how to reparameterise a statistical model to get the effect of an exposure for each level of a modifier.

#Interaction term stata 12 code

The code used in this tutorial is available here.

  • Testing significance of the interaction.
  • Interaction model (default parameterisation).







  • Interaction term stata 12