thanks in advance for any help.
I want to use clogit to calc some adjusted odds-ratios (risk of getting typhoid fever given stated exposures).
Many of the exposures were 3 category (eg, 1 never, 2 sometimes, 3 often).
The exposures, for ease of interpretation, I want to recode to binary (never, at-least-sometimes)
and I want to do this in a batch way, so I want the batch file to run with temporary array variables, that self-destruct, I don't want to worry about dropping later, also I could document recoding tweaks quickly & as suits.
I get impression what I want should be possible with stata local command, but either syntax defeats me or it's wrong command to use.
eg, my algorithm in do-file is supposed to be
==================================
use my-data-file
log logfilename
//next 3 lines not actual STATA commands, I don't understand what STATA commands to use
recode exposureA into tempvarA, following rule (where exposure = 1, assign 0, else assign 1)
recode exposureB into tempvarB , as prev
recode exposureC into tempvarC , as prev
clogit outcome tempvarA tempvarB tempvarC, group(groupnumbers) OR
log close
========================
and when that finishes running, tempvarA-C are all deleted b/c they are meant to be temporary, but the logfile will show me the ORs I want to be looking at.
If you can follow that... can you advise how to make the tempvars?
Mega thanks...!
ps: while I'm at it, is there a way to see lots of examples of commands being used other than exhaustive google searches? I struggle to understand command syntax without seeing lots of working examples, the system helpfiles have few examples of working syntax
I want to use clogit to calc some adjusted odds-ratios (risk of getting typhoid fever given stated exposures).
Many of the exposures were 3 category (eg, 1 never, 2 sometimes, 3 often).
The exposures, for ease of interpretation, I want to recode to binary (never, at-least-sometimes)
and I want to do this in a batch way, so I want the batch file to run with temporary array variables, that self-destruct, I don't want to worry about dropping later, also I could document recoding tweaks quickly & as suits.
I get impression what I want should be possible with stata local command, but either syntax defeats me or it's wrong command to use.
eg, my algorithm in do-file is supposed to be
==================================
use my-data-file
log logfilename
//next 3 lines not actual STATA commands, I don't understand what STATA commands to use
recode exposureA into tempvarA, following rule (where exposure = 1, assign 0, else assign 1)
recode exposureB into tempvarB , as prev
recode exposureC into tempvarC , as prev
clogit outcome tempvarA tempvarB tempvarC, group(groupnumbers) OR
log close
========================
and when that finishes running, tempvarA-C are all deleted b/c they are meant to be temporary, but the logfile will show me the ORs I want to be looking at.
If you can follow that... can you advise how to make the tempvars?
Mega thanks...!
ps: while I'm at it, is there a way to see lots of examples of commands being used other than exhaustive google searches? I struggle to understand command syntax without seeing lots of working examples, the system helpfiles have few examples of working syntax
Comment