Hello,
I have 168 participants who meet the criteria for being a case. 860 controls. 211 with missing data so cannot be grouped. From the variables of interest I have about 300 participants with entirely missing data. Should they be removed from being a case/control?
I've matched so far my cases and controls 2:1 on age and gender. The overall age range of the sample is 7 years 8 months - 10 years 6 months. This is my code:
I have then reshaped to long in preparation for clogit with the following code:
I now am a bit stuck. I want to do a very simple test at this point just to see whether there is a difference between cases and controls for certain variables and whether this is statitsically significant. For example, I have a continuous variable - BMI. I want to know do cases have a higher BMI for controls and is this statistically significant.
I also have another variable that asks does the participant have short sleep, which I have recoded from a continuous variable to categorical where 1 = yes and 0 = no. Can I enter both this continuous variable and categorical variable into clogit? Is it possible though to find out if each variable is individually significantly different for cases vs controls before entering into a model? I really just want something very simple.
To complicate things further I have a cluster variable that has rather a large number of values that I need to control for (geographical area).
Any help gratefully appreciated.
I have 168 participants who meet the criteria for being a case. 860 controls. 211 with missing data so cannot be grouped. From the variables of interest I have about 300 participants with entirely missing data. Should they be removed from being a case/control?
I've matched so far my cases and controls 2:1 on age and gender. The overall age range of the sample is 7 years 8 months - 10 years 6 months. This is my code:
Code:
preserve . keep if case (860 observations deleted) . drop case . tempfile cases . save `cases' file C:\Users\Guest\AppData\Local\Temp\ST_4790_000008.tmp saved . restore . drop if case (379 observations deleted) . drop case . ds c1dage cdgender, not uniqueid variables etc . rename (`r(varlist)') =_ctrl . tempfile controls . save `controls' file C:\Users\Guest\AppData\Local\Temp\ST_4790_000009.tmp saved . use `cases' . rangejoin c1dage -1 1 using `controls', by(cdgender) (using rangestat version 1.1.1) . set seed 8846 . gen double shuffle = runiform() . duplicates drop Duplicates in terms of all variables (0 observations are duplicates) . by uniqueid (shuffle), sort: keep if _n <= 2 (152,179 observations deleted) . by uniqueid (shuffle), sort: keep if _n <= 2 (0 observations deleted) . drop shuffle
Code:
ds *_ctrl, not
uniqueid c1dage variables etc
. local vbles `r(varlist)'
. rename (`vbles') =_case
. gen long obs_num = _n
. clonevar group_id = uniqueid_case
. reshape long `vbles', i(obs_num) j(cc) string
(note: j = _case _ctrl)
(note: cdgender_ctrl not found)
(note: c1dage_ctrl not found)
(note: c1dage_U_ctrl not found)
Data wide -> long
-----------------------------------------------------------------------------
Number of obs. 758 -> 1516
Number of variables 49 -> 28
j variable (2 values) -> cc
xij variables:
uniqueid_case uniqueid_ctrl -> uniqueid
c1dage_U_case c1dage_U_ctrl -> c1dage_U
other variables etc
-----------------------------------------------------------------------------
. drop obs_num
. duplicates drop if cc == "_case"
Duplicates in terms of all variables
(2 observations deleted)
I also have another variable that asks does the participant have short sleep, which I have recoded from a continuous variable to categorical where 1 = yes and 0 = no. Can I enter both this continuous variable and categorical variable into clogit? Is it possible though to find out if each variable is individually significantly different for cases vs controls before entering into a model? I really just want something very simple.
To complicate things further I have a cluster variable that has rather a large number of values that I need to control for (geographical area).
Any help gratefully appreciated.

Comment