Hi all,
I am using STATA to analyze data from MEPS (medical expenditure survey panel), which is (as listed on the website) "a set of large-scale surveys of families and individuals, their medical providers (doctors, hospitals, pharmacies, etc.), and employers across the United States. MEPS collects data on the specific health services that Americans use, how frequently they use them, the cost of these services, and how they are paid for, as well as data on the cost, scope, and breadth of health insurance held by and available to U.S. workers."
I am studying patients with a specific disease population and have already created my files for my population of interest (patients with atopic dermatitis who have skin infections) and control population (patients with atopic dermatitis without skin infections). I am specifically looking at the expenditures of my population of interest and comparing them to my control population.
I am looking all the data from 1996-2015 (so each years data must be analyzed separately).
When running my codes for expenditure data, I have to combine a "full year consolidated file" (contains the expenditure variables for every medical condition) and the population file I created for the atopic dermatitis (AD) patients with skin infections. I do this via "form all pairwise combinations within groups," giving me the file with the expenditures for my specific population of interest (atopic dermatitis with skin infections).
Then, I establish the variables so that I can calculate expenditures for each type of service visit (inpatient, ambulatory (made up of outpatient variables), emergency, prescribed medicines etc). It is when calculating the means for the expenses for some visits for certain years that I get this error message: all observations in subpop() subpopulation have zero weights
r(461);.
STATA help feature states that the issue is the following: " code 461. fpc for all observations within a stratum must be the same;There is a problem with your fpc variable; see [SVY] svyset."
I am not sure how to edit the coding in my svyset data code to account for the fpc.
I have listed my exact coding below, if anyone has any idea of how to resolve this issue please let me know as I have an upcoming deadline for my data. I am pretty new to STATA and using the STATA with MEPS for the first time, so any help is appreciated.
________________________________________________
import sasxport "h121.ssp"
. destring dupersid, replace
dupersid has all characters numeric; replaced as long
. save "/Users/jeenasandhu/Desktop/2008 full year file.dta"
file /Users/jeenasandhu/Desktop/2008 full year file.dta saved
. joinby dupersid using "/Users/jeenasandhu/Desktop/2008 AD with skin infxns.dta", unmatched(none)
. gen total=totexp08
. gen hospital_inpatient = ipdexp08 + ipfexp08
. gen ambulatory = obvexp08 + opdexp08 + opfexp08
. gen emergency = erdexp08 + erfexp08
. gen prescribed_medicines = rxexp08
. foreach var in total hospital_inpatient ambulatory emergency prescribed_medicines {
2. gen x_`var'=(`var'>0)
3. }
. svyset [pweight= perwt08f], strata( varstr) psu(varpsu) vce(linearized) singleunit(certainty)
pweight: perwt08f
VCE: linearized
Single unit: certainty
Strata 1: varstr
SU 1: varpsu
FPC 1: <zero>
. svy, subpop(x_total): mean total
(running mean on estimation sample)
all observations in subpop() subpopulation have zero weights
r(461);
. svy, subpop(x_ambulatory): mean ambulatory
(running mean on estimation sample)
all observations in subpop() subpopulation have zero weights
r(461);
etc.
_________________________________________
Thank you.
I am using STATA to analyze data from MEPS (medical expenditure survey panel), which is (as listed on the website) "a set of large-scale surveys of families and individuals, their medical providers (doctors, hospitals, pharmacies, etc.), and employers across the United States. MEPS collects data on the specific health services that Americans use, how frequently they use them, the cost of these services, and how they are paid for, as well as data on the cost, scope, and breadth of health insurance held by and available to U.S. workers."
I am studying patients with a specific disease population and have already created my files for my population of interest (patients with atopic dermatitis who have skin infections) and control population (patients with atopic dermatitis without skin infections). I am specifically looking at the expenditures of my population of interest and comparing them to my control population.
I am looking all the data from 1996-2015 (so each years data must be analyzed separately).
When running my codes for expenditure data, I have to combine a "full year consolidated file" (contains the expenditure variables for every medical condition) and the population file I created for the atopic dermatitis (AD) patients with skin infections. I do this via "form all pairwise combinations within groups," giving me the file with the expenditures for my specific population of interest (atopic dermatitis with skin infections).
Then, I establish the variables so that I can calculate expenditures for each type of service visit (inpatient, ambulatory (made up of outpatient variables), emergency, prescribed medicines etc). It is when calculating the means for the expenses for some visits for certain years that I get this error message: all observations in subpop() subpopulation have zero weights
r(461);.
STATA help feature states that the issue is the following: " code 461. fpc for all observations within a stratum must be the same;There is a problem with your fpc variable; see [SVY] svyset."
I am not sure how to edit the coding in my svyset data code to account for the fpc.
I have listed my exact coding below, if anyone has any idea of how to resolve this issue please let me know as I have an upcoming deadline for my data. I am pretty new to STATA and using the STATA with MEPS for the first time, so any help is appreciated.
________________________________________________
import sasxport "h121.ssp"
. destring dupersid, replace
dupersid has all characters numeric; replaced as long
. save "/Users/jeenasandhu/Desktop/2008 full year file.dta"
file /Users/jeenasandhu/Desktop/2008 full year file.dta saved
. joinby dupersid using "/Users/jeenasandhu/Desktop/2008 AD with skin infxns.dta", unmatched(none)
. gen total=totexp08
. gen hospital_inpatient = ipdexp08 + ipfexp08
. gen ambulatory = obvexp08 + opdexp08 + opfexp08
. gen emergency = erdexp08 + erfexp08
. gen prescribed_medicines = rxexp08
. foreach var in total hospital_inpatient ambulatory emergency prescribed_medicines {
2. gen x_`var'=(`var'>0)
3. }
. svyset [pweight= perwt08f], strata( varstr) psu(varpsu) vce(linearized) singleunit(certainty)
pweight: perwt08f
VCE: linearized
Single unit: certainty
Strata 1: varstr
SU 1: varpsu
FPC 1: <zero>
. svy, subpop(x_total): mean total
(running mean on estimation sample)
all observations in subpop() subpopulation have zero weights
r(461);
. svy, subpop(x_ambulatory): mean ambulatory
(running mean on estimation sample)
all observations in subpop() subpopulation have zero weights
r(461);
etc.
_________________________________________
Thank you.
Comment