Hi everyone
I am doing a piece of work looking at determinants of abortion in a sample of women using electronic health records from primary care practices. I am using an open cohort over 10 years so my dataset is quite big (4mill women so far).
I am looking at a matched case control design, using abortion event as outcome and seeing if various factors (eg age, deprivation, history of previous abortions, smoking, alcohol use etc) are predictors using regression analysis.
Currently I am stuck at trying to do a 1:n matching - I have enough patients to do at the very least 1:2 to 1:5 matching. However, after looking at the forum chats it looks like there isn't a simple programme on Stata which can do that!
A random sample of my dataset is as follows:
input double patid int EVENT long medcode int(yob pracid) byte region float abort
1022310159 13515 1686 1966 10159 12 1
2229310229 17716 6039 1966 10229 8 0
6702810229 13149 255 1966 10229 8 1
1568310093 19982 12944 1968 10093 6 0
1784210093 12784 255 1968 10093 6 1
40110303 17070 461 1968 10303 9 0
2364410303 11323 1748 1968 10303 9 1
806210981 18604 91 1968 10981 12 0
1875910981 12784 1686 1968 10981 12 1
300010025 14936 5926 1969 10025 2 0
281610025 11183 255 1969 10025 2 1
2591110342 15537 1 1969 10342 3 0
2476910342 9497 1748 1969 10342 3 1
617510442 17149 11955 1969 10442 1 0
2127810442 10958 2187 1969 10442 1 1
271010500 18644 6677 1969 10500 13 0
1063410500 12116 1748 1969 10500 13 1
2321010586 19521 795 1969 10586 5 0
666410586 16617 1686 1969 10586 5 1
772510797 18483 56 1969 10797 12 0
1128210797 14538 1686 1969 10797 12 1
To start with I would like to match on practice (Pracid) first, then practice and age (using YOB). I haven't added any other covariates yet to this dataset.
Is there any easy way to do the matching? I can only find ccmatch which only does 1:1 matching.
Many thanks!
Richard
I am doing a piece of work looking at determinants of abortion in a sample of women using electronic health records from primary care practices. I am using an open cohort over 10 years so my dataset is quite big (4mill women so far).
I am looking at a matched case control design, using abortion event as outcome and seeing if various factors (eg age, deprivation, history of previous abortions, smoking, alcohol use etc) are predictors using regression analysis.
Currently I am stuck at trying to do a 1:n matching - I have enough patients to do at the very least 1:2 to 1:5 matching. However, after looking at the forum chats it looks like there isn't a simple programme on Stata which can do that!
A random sample of my dataset is as follows:
input double patid int EVENT long medcode int(yob pracid) byte region float abort
1022310159 13515 1686 1966 10159 12 1
2229310229 17716 6039 1966 10229 8 0
6702810229 13149 255 1966 10229 8 1
1568310093 19982 12944 1968 10093 6 0
1784210093 12784 255 1968 10093 6 1
40110303 17070 461 1968 10303 9 0
2364410303 11323 1748 1968 10303 9 1
806210981 18604 91 1968 10981 12 0
1875910981 12784 1686 1968 10981 12 1
300010025 14936 5926 1969 10025 2 0
281610025 11183 255 1969 10025 2 1
2591110342 15537 1 1969 10342 3 0
2476910342 9497 1748 1969 10342 3 1
617510442 17149 11955 1969 10442 1 0
2127810442 10958 2187 1969 10442 1 1
271010500 18644 6677 1969 10500 13 0
1063410500 12116 1748 1969 10500 13 1
2321010586 19521 795 1969 10586 5 0
666410586 16617 1686 1969 10586 5 1
772510797 18483 56 1969 10797 12 0
1128210797 14538 1686 1969 10797 12 1
To start with I would like to match on practice (Pracid) first, then practice and age (using YOB). I haven't added any other covariates yet to this dataset.
Is there any easy way to do the matching? I can only find ccmatch which only does 1:1 matching.
Many thanks!
Richard
Comment