Back to HC-197I
MEPSdofileA.log
name: <unnamed>
log: C:\Program Files\STATA\MEPSdofileA.log
log type: text
opened on: 18 Jul 2019, 13:55:12
. /* BE SURE TO UPDATE VALUES FOR CURRENT FY */
. local yr=17
. local evntnum=197
. local condnum=199
. * Get condition records coded as asthma.
. use "C:\Program Files\STATA\H`condnum'.dta", clear
. keep if ICD10CDX =="J45"
(110,530 observations deleted)
. keep CONDIDX ICD10CDX
. * Get the events linked to each of the asthma condition records.
. sort CONDIDX
. /* sample print of work.asconds - sorted by condidx;
> COND (H&condnum) records where ICD10CDX = 'J45'*/
. list if _n<=50, separator(0)
. export excel " C:\Program Files \STATA\a1.xlsx",
replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. save "C:\Program Files\STATA\ASCONDS.dta", replace
file C:\Program Files\STATA\ASCONDS.dta saved
. use "C:\Program Files\STATA\H`evntnum'IF1.dta", clear
. sort CONDIDX
. label define eventype1 1 "1 MVIS"
. label define eventype1 2 "2 OPAT", add
. label define eventype1 3 "3 EROM", add
. label define eventype1 4 "4 STAZ", add
. label define eventype1 5 "5 DVIS", add
. label define eventype1 6 "6 OMED", add
. label define eventype1 7 "7 HVIS", add
. label define eventype1 8 "8 PMED", add
. label values EVENTYPE eventype1
. save "C:\Program Files\STATA\CLNK.dta", replace
file C:\Program Files\STATA\CLNK.dta saved
. keep CONDIDX EVNTIDX EVENTYPE
. merge m:m CONDIDX using "C:\Program
Files\STATA\ASCONDS.dta", keepusing(CONDIDX) nogene
> rate keep(match)
Result # of obs.
not matched 0
matched 6,756
. save "C:\Program Files\STATA\ASCLNKS.dta", replace
file C:\Program Files\STATA\ASCLNKS.dta saved
. label variable CONDIDX "condidx"
. label variable EVNTIDX "evntidx"
. label variable EVENTYPE "eventype"
. /* sample print of work.asclnks - sorted by condidx;
> events linked to asthma condition records */
. list CONDIDX EVNTIDX EVENTYPE if _n<=75,
sepby(CONDIDX) noobs
. export excel "C:\Program Files\STATA\a1.xlsx",
replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. sort EVNTIDX
. /* sample print of work.asclnks - sorted by evntidx */
. list if _n<=50, separator(0)
. export excel "C:\Program Files\STATA\a1.xlsx",
replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. keep EVNTIDX EVENTYPE
. gen first=0
. by EVNTIDX, sort: replace first=1 if _n==1
(6,744 real changes made)
. keep if first==1
(12 observations deleted)
. drop first
. . save "C:\Program Files\STATA\ASCLNKS.dta", replace
file C:\Program Files\STATA\ASCLNKS.dta saved
. /* sample print of unique evntidxs from work.asclnks */
. list if _n<=50, separator(0)
. export excel "C:\Program Files\STATA\a1.xlsx",
replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. * Get non-telephone office based visits (i.e. MVIS events) for persons with positive weights.
. use "C:\Program Files\STATA\H`evntnum'G.dta", clear
. keep EVNTIDX PERWT`yr'F SEETLKPV
. keep if PERWT`yr'F > 0 & SEETLKPV != 2
(3,595 observations deleted)
. save "C:\Program Files\STATA\MVIS.dta", replace
file C:\Program Files\STATA\MVIS.dta saved
. sort EVNTIDX
. * Identify MVIS events which were for asthma.
. keep EVNTIDX
. merge m:m EVNTIDX using "C:\Program Files\STATA\ASCLNKS.dta", nogenerate keep(match)
Result # of obs.
not matched 0
matched 1,680
. save "C:\Program Files\STATA\ASMVIS.dta", replace
file C:\Program Files\STATA\ASMVIS.dta saved
. /* sample print of work.asmvis;
> unique EVNTIDXS from work.asclnks that are
non-telephone MVIS (HC-197G) events */
. list if _n<=50, separator(0)
. export excel "C:\Program Files\STATA\a1.xlsx",
replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. * Get PMED IDs linked to the MVIS events which were
for asthma.
.
. use "C:\Program Files\STATA\H`evntnum'IF2.dta", clear
. sort EVNTIDX
. save "C:\Program Files\STATA\RXLK.dta", replace
file C:\Program Files\STATA\RXLK.dta saved
. keep EVNTIDX LINKIDX EVENTYPE
. label define eventype1 1 "1 MVIS"
. label define eventype1 2 "2 OPAT", add
. label define eventype1 3 "3 EROM", add
. label define eventype1 4 "4 STAZ", add
. label define eventype1 5 "5 DVIS", add
. label define eventype1 6 "6 OMED", add
. label define eventype1 7 "7 HVIS", add
. label define eventype1 8 "8 PMED", add
. label values EVENTYPE eventype1
. label variable LINKIDX "linkidx"
. /* sample print of work.rxlk - sorted by evntidx;
> Rx+event link file records (HC-197IF2) */
. list EVNTIDX LINKIDX EVENTYPE if _n<=140,
sepby(EVNTIDX) noobs
. export excel "C:\Program Files\STATA\a1.xlsx",
replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. merge m:m EVNTIDX using "C:\Program
Files\STATA\ASMVIS.dta", keepusing(EVNTIDX) nogener
> ate keep(match)
(label eventype1 already defined)
Result # of obs.
not matched 0
matched 1,418
. save "C:\Program Files\STATA\PMEDIDS.dta", replace
file C:\Program Files\STATA\PMEDIDS.dta saved
. /* sample print of work.pmedids - sorted by evntidx;
> work.rxlk records for evntidxs in work.asmvis */
. list EVNTIDX LINKIDX EVENTYPE if _n<=50,
sepby(EVNTIDX) noobs
. export excel "C:\Program Files\STATA\a1.xlsx",
replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. sort LINKIDX
. /* sample print of work.pmedids - sorted by linkidx */
. list if _n<=50, separator(0)
. export excel "C:\Program Files\STATA\a1.xlsx",
replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. keep LINKIDX
. gen first=0
. by LINKIDX, sort: replace first=1 if _n==1
(1,371 real changes made)
. keep if first==1
(47 observations deleted)
. drop first
. save "C:\Program Files\STATA\PMEDIDS.dta", replace
file C:\Program Files\STATA\PMEDIDS.dta saved
. /* sample print of unique linkidxs in work.pmedids */
. list if _n<=50, separator(0)
. export excel "C:\Program Files\STATA\a1.xlsx",
replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. * Get PMED records linked to MVIS events which were
for asthma.
.
. use "C:\Program Files\STATA\H`evntnum'A.dta", clear
. sort LINKIDX
. *save "C:\Program Files\STATA\PMED.dta", replace
. keep LINKIDX RXRECIDX RXXP`yr'X PERWT`yr'F RXNAME
. merge m:m LINKIDX using "C:\Program
Files\STATA\PMEDIDS.dta", nogenerate keep(match usi
> ng)
Result # of obs.
not matched 0
matched 3,534
. save "C:\Program Files\STATA\MVPMEDS.dta", replace
file C:\Program Files\STATA\MVPMEDS.dta saved
. sort LINKIDX
. label variable RXRECIDX "rxrecidx"
. label variable RXNAME "rxname"
. label variable RXXP`yr'X "rxxp17x"
. label variable PERWT`yr'F "perwt17f"
. /* sample print of work.mvpmeds;
> PMED (HC-197A) records for unique linkidxs in work.pmedids */
. list LINKIDX RXRECIDX RXNAME RXXP`yr'X PERWT`yr'F if _n<=200, sepby(LINKIDX) noobs
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. /* Total Rx expenditures associated with medical visits (excluding telephone) for asthma */
. tabstat RXXP`yr'X, stat(n sum) format(%15.2fc)
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. /* Total Rx expenditures associated with medical visits (excluding telephone) for asthma;
> Weighted */
. tabstat RXXP`yr'X[w=PERWT`yr'F], stat(n sum) format(%15.2fc)
(analytic weights assumed)
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
end of do-file
. exit, clear
MEPSdofileB.log
name: <unnamed>
log: C:\Program Files\STATA\MEPSdofileB.log
log type: text
opened on: 18 Jul 2019, 13:55:35
. /* BE SURE TO UPDATE VALUES FOR CURRENT FY */
. local yr=17
. local evntnum=197
. local condnum=199
. * Get condition records coded as asthma.
.
. use "C:\Program Files\STATA\H`condnum'.dta", clear
. keep if ICD10CDX =="J45"
(110,530 observations deleted)
. keep CONDIDX ICD10CDX
. * Get the events linked to each of the asthma condition records.
.
. sort CONDIDX
. /* sample print of work.asconds - sorted by condidx;
> COND (H&condnum) records where ICD10CDX = 'J45'*/
. list if _n<=50, separator(0)
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. save "C:\Program Files\STATA\ASCONDS.dta", replace
file C:\Program Files\STATA\ASCONDS.dta saved
. use "C:\Program Files\STATA\H`evntnum'IF1.dta", clear
. sort CONDIDX
. label define eventype1 1 "1 MVIS"
. label define eventype1 2 "2 OPAT", add
. label define eventype1 3 "3 EROM", add
. label define eventype1 4 "4 STAZ", add
. label define eventype1 5 "5 DVIS", add
. label define eventype1 6 "6 OMED", add
. label define eventype1 7 "7 HVIS", add
. label define eventype1 8 "8 PMED", add
. label values EVENTYPE eventype1
. save "C:\Program Files\STATA\CLNK.dta", replace
file C:\Program Files\STATA\CLNK.dta saved
. keep CONDIDX EVNTIDX EVENTYPE
. merge m:m CONDIDX using "C:\Program
Files\STATA\ASCONDS.dta", keepusing(CONDIDX) nogene
> rate keep(match)
Result # of obs.
not matched 0
matched 6,756
. save "C:\Program Files\STATA\ASCLNKS.dta", replace
file C:\Program Files\STATA\ASCLNKS.dta saved
. label variable CONDIDX "condidx"
. label variable EVNTIDX "evntidx"
. label variable EVENTYPE "eventype"
. /* sample print of work.asclnks - sorted by condidx;
> events linked to asthma condition records */
. list CONDIDX EVNTIDX EVENTYPE if _n<=75,
sepby(CONDIDX) noobs
. export excel "C:\Program Files\STATA\a1.xlsx",
replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. sort EVNTIDX
. /* sample print of work.asclnks - sorted by evntidx */
. list if _n<=50, separator(0)
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. keep EVNTIDX EVENTYPE
. gen first=0
. by EVNTIDX, sort: replace first=1 if _n==1
(6,744 real changes made)
. keep if first==1
(12 observations deleted)
. drop first
. /* sample print of unique evntidxs from work.asclnks */
. list if _n<=50, separator(0)
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. rename EVNTIDX LINKIDX
. save "C:\Program Files\STATA\ASCLNKS.dta", replace
file C:\Program Files\STATA\ASCLNKS.dta saved
. * Get PMED records linked to MVIS events which were for asthma.
.
. use "C:\Program Files\STATA\H`evntnum'A.dta", clear
. sort LINKIDX
. *save "C:\Program Files\STATA\PMED.dta", replace
. keep LINKIDX RXRECIDX RXXP`yr'X PERWT`yr'F RXNAME
. merge m:m LINKIDX using "C:\Program
Files\STATA\ASCLNKS.dta", nogenerate keep(match)
Result # of obs.
not matched 0
matched 10,303
. keep if PERWT`yr'F > 0
(176 observations deleted)
. save "C:\Program Files\STATA\ASPMEDS.dta", replace
file C:\Program Files\STATA\ASPMEDS.dta saved
. sort LINKIDX
. label variable RXRECIDX "rxrecidx"
. label variable RXNAME "rxname"
. label variable RXXP`yr'X "rxxp17x"
. label variable PERWT`yr'F "perwt17f"
. /* sample print of work.aspmeds;
> PMED (HC197A) records which link to condition records coded as asthma */
. list LINKIDX RXRECIDX RXNAME RXXP`yr'X PERWT`yr'F if _n<=300, sepby(LINKIDX) noobs
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. /* Total Rx expenditures associated with asthma */
. tabstat RXXP`yr'X, stat(n sum) format(%15.2fc)
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. /* Total Rx expenditures associated with asthma
> Weighted */
. tabstat RXXP`yr'X[w=PERWT`yr'F], stat(n sum) format(%15.2fc)
(analytic weights assumed)
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
end of do-file
. exit, clear
MEPSdofileC.log
name: <unnamed>
log: C:\Program Files\STATA\MEPSdofileC.log
log type: text
opened on: 18 Jul 2019, 13:57:39
. /* BE SURE TO UPDATE VALUES FOR CURRENT FY */
. local yr=17
. local evntnum=197
. local condnum=199
.
. * Get condition records coded as asthma.
.
. use "C:\Program Files\STATA\H`condnum'.dta", clear
. keep if ICD10CDX =="J45"
(110,530 observations deleted)
. keep CONDIDX ICD10CDX
. * Get the events linked to each of the asthma condition records.
.
. sort CONDIDX
. /* sample print of work.asconds - sorted by condidx;
> COND (H&condnum) records where ICD10CDX = 'J45'*/
. list if _n<=50, separator(0)
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. save "C:\Program Files\STATA\ASCONDS.dta", replace
file C:\Program Files\STATA\ASCONDS.dta saved
. use "C:\Program Files\STATA\H`evntnum'IF1.dta", clear
. sort CONDIDX
. label define eventype1 1 "1 MVIS"
. label define eventype1 2 "2 OPAT", add
. label define eventype1 3 "3 EROM", add
. label define eventype1 4 "4 STAZ", add
. label define eventype1 5 "5 DVIS", add
. label define eventype1 6 "6 OMED", add
. label define eventype1 7 "7 HVIS", add
. label define eventype1 8 "8 PMED", add
. label values EVENTYPE eventype1
. save "C:\Program Files\STATA\CLNK.dta", replace
file C:\Program Files\STATA\CLNK.dta saved
. keep CONDIDX EVNTIDX EVENTYPE
. merge m:m CONDIDX using "C:\Program Files\STATA\ASCONDS.dta", keepusing(CONDIDX) nogene
> rate keep(match)
Result # of obs.
not matched 0
matched 6,756
. save "C:\Program Files\STATA\ASCLNKS.dta", replace
file C:\Program Files\STATA\ASCLNKS.dta saved
. label variable CONDIDX "condidx"
. label variable EVNTIDX "evntidx"
. label variable EVENTYPE "eventype"
. /* sample print of work.asclnks - sorted by condidx;
> events linked to asthma condition records */
. list CONDIDX EVNTIDX EVENTYPE if _n<=75, sepby(CONDIDX) noobs
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. sort EVNTIDX
. /* sample print of work.asclnks - sorted by evntidx */
. list if _n<=50, separator(0)
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. keep EVNTIDX EVENTYPE
. gen first=0
. by EVNTIDX, sort: replace first=1 if _n==1
(6,744 real changes made)
. keep if first==1
(12 observations deleted)
. drop first
. save "C:\Program Files\STATA\ASCLNKS.dta", replace
file C:\Program Files\STATA\ASCLNKS.dta saved
. /* sample print of unique evntidxs from work.asclnks */
. list if _n<=50, separator(0)
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. * Get non-telephone office based visits (i.e. MVIS events) for persons with positive weights.
.
. use "C:\Program Files\STATA\H`evntnum'G.dta", clear
. keep EVNTIDX PERWT`yr'F SEETLKPV OBXP`yr'X
. keep if PERWT`yr'F > 0 & SEETLKPV != 2
(3,595 observations deleted)
. save "C:\Program Files\STATA\MVIS.dta", replace
file C:\Program Files\STATA\MVIS.dta saved
. sort EVNTIDX
.
. * Identify MVIS events which were for asthma.
.
. *keep EVNTIDX
. merge m:m EVNTIDX using "C:\Program Files\STATA\ASCLNKS.dta", nogenerate keep(match)
Result # of obs.
not matched 0
matched 1,680
. save "C:\Program Files\STATA\ASMVIS.dta", replace
file C:\Program Files\STATA\ASMVIS.dta saved
. /* sample print of work.asmvis;
> unique evntidxs from work.asclnks that are non-telephone MVIS (HC197G) events */
. list EVNTIDX EVENTYPE SEETLKPV OBXP`yr'X PERWT`yr'F if _n<=50, separator(0)
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. /* Total medical visit expenditures (excluding telephone) associated with asthma */
. tabstat OBXP`yr'X, stat(n sum) format(%15.2fc)
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
. /* Total medical visit expenditures (excluding telephone) associated with asthma;
> Weighted */
. tabstat OBXP`yr'X[w=PERWT`yr'F], stat(n sum) format(%15.2fc)
(analytic weights assumed)
. export excel "C:\Program Files\STATA\a1.xlsx", replace firstrow(variables)
file C:\Program Files\STATA\a1.xlsx saved
end of do-file
. exit, clear
Back to top
|