I am getting caught up in the code at the last point and was wanting some advice,
I have a data of breast cancer
Two Categorical Variables
stage - Stage 1, 2, or 3
type - Ductal (1), Medullary (2). Mucinous (3), Papillary (4)
One Indicator Variable
sex - Male (1), Female (2)
One continous variable
survtime
I want to work out the average survival in stage by sex and type by sex,
I have tried to code but get tripped up at the end,
The following works and gives me overall means stratified by sex
local vars stage type
foreach x in local vars {
forvalues i=1/2 {
summarize survtime if sex==`i' , detail
return list
}
}
But when I try to split the groups by their individual categories I keep getting errors
local vars stage type
foreach x in local vars {
forvalues i=1/2 {
forvalues j=1/4{
capture noisily summarize survtime if sex==`i' & `x”==`j', detail
return list
}
}
}
`x” invalid name ???
Thanks
I have a data of breast cancer
Two Categorical Variables
stage - Stage 1, 2, or 3
type - Ductal (1), Medullary (2). Mucinous (3), Papillary (4)
One Indicator Variable
sex - Male (1), Female (2)
One continous variable
survtime
I want to work out the average survival in stage by sex and type by sex,
I have tried to code but get tripped up at the end,
The following works and gives me overall means stratified by sex
local vars stage type
foreach x in local vars {
forvalues i=1/2 {
summarize survtime if sex==`i' , detail
return list
}
}
But when I try to split the groups by their individual categories I keep getting errors
local vars stage type
foreach x in local vars {
forvalues i=1/2 {
forvalues j=1/4{
capture noisily summarize survtime if sex==`i' & `x”==`j', detail
return list
}
}
}
`x” invalid name ???
Thanks
Comment