-
Login or Register
- Log in with
sort `touse' count if `touse' sort `touse' sortvar in `=_N-`r(N)'+1'/`=_N'
gen byte `invtouse' = 1-`touse'
clear all cd ~/Downloads set obs 1000 mata: // Store data directly with st_store() st_store(.,st_addvar("double",("x1","x2"),1),runiform(st_nobs(),2)) end g long id = floor(_n/10) g byte time = mod(_n,10) xtset id time g l1x1 = l.x1 sort x2 xtset g l1x1_2 = l.x1 exit
csti 23 130 13 127
*! version 1.0.7 12sep2014 \ Philip M Jones, [email protected] /* csit.ado: Wrapper program for csi to use total number of patients. */ /* Example: for 23 events in 130 patients in one group, 13 events in 127 patients in another group */ /* "csti 23 130 13 127" */ /* all options for -csi- will continue to work as they are passed along */ capture program drop csti program define csti version 13 syntax anything [, *] tokenize `anything' local n1 `1' local N1 `2' local n2 `3' local N2 `4' local N_1 = `N1' - `n1' local N_2 = `N2' - `n2' csi `n1' `n2' `N_1' `N_2', `options' end
csi 23 13 107 117 | Exposed Unexposed | Total -----------------+------------------------+------------ Cases | 23 13 | 36 Noncases | 107 117 | 224 -----------------+------------------------+------------ Total | 130 130 | 260 | | Risk | .1769231 .1 | .1384615 | | | Point estimate | [95% Conf. Interval] |------------------------+------------------------ Risk difference | .0769231 | -.0065187 .1603649 Risk ratio | 1.769231 | .9374361 3.339083 Attr. frac. ex. | .4347826 | -.0667393 .7005166 Attr. frac. pop | .2777778 | +------------------------------------------------- chi2(1) = 3.22 Pr>chi2 = 0.0726
csi 23 13 130 130, total | Exposed Unexposed | Total -----------------+------------------------+------------ Cases | 23 13 | 36 Noncases | 107 117 | 224 -----------------+------------------------+------------ Total | 130 130 | 260 | | Risk | .1769231 .1 | .1384615 | | | Point estimate | [95% Conf. Interval] |------------------------+------------------------ Risk difference | .0769231 | -.0065187 .1603649 Risk ratio | 1.769231 | .9374361 3.339083 Attr. frac. ex. | .4347826 | -.0667393 .7005166 Attr. frac. pop | .2777778 | +------------------------------------------------- chi2(1) = 3.22 Pr>chi2 = 0.0726
Leave a comment: