Hello everyone,
I am currently examining hospital-acquired infections from a region between 2001 and 2020 with Stata 16 IC. For analysis purposes, I have created 20 yearly cross-sectional datasets containing the year of registration, the age category (four ordinal categories), the sex (as a binary variable) and the infection (also as a binary variable, infected or not infected).
First, I estimated yearly crude prevalences and their 95% confidence intervals as percentages (multiplied by 100) with
Then, I wanted to test the null hypothesis of no difference in prevalences between two years (e.g. 2019 and 2016). I took the results obtained above as well as the total of yearly observations for both years of interest to compute a two-sample test of proportion using prtesti.
Now, I would like to account for demographic changes over time by adjusting all yearly prevalences by age and sex, using methods of direct standardization with the total of the study populations (i.e. as standard population). I have merged all datasets and the main database looks like the following:
I can calculate the weights by hand, meaning that I can estimate the number of infections I would expect if each yearly population had the same age and sex structures as the standard population.
However, I guess it would be more appropriate to use dstdize to obtain age- and sex-adjusted yearly prevalences and their 95% confidence intervals. I have checked the examples provided in the manual but I cannot find a solution.
What would be the most elegant way to proceed?
Thanks in advance,
Romain
I am currently examining hospital-acquired infections from a region between 2001 and 2020 with Stata 16 IC. For analysis purposes, I have created 20 yearly cross-sectional datasets containing the year of registration, the age category (four ordinal categories), the sex (as a binary variable) and the infection (also as a binary variable, infected or not infected).
First, I estimated yearly crude prevalences and their 95% confidence intervals as percentages (multiplied by 100) with
Code:
ci proportion INFECTED
Now, I would like to account for demographic changes over time by adjusting all yearly prevalences by age and sex, using methods of direct standardization with the total of the study populations (i.e. as standard population). I have merged all datasets and the main database looks like the following:
Code:
input int YEAR float AGECAT byte SEX float INFECTED 2020 0 2 1 2016 4 1 0 2002 0 2 0 2010 2 1 1 2020 1 1 0 2018 3 2 0 2011 2 2 0 2017 1 1 0 2003 0 2 0 2020 3 2 0
However, I guess it would be more appropriate to use dstdize to obtain age- and sex-adjusted yearly prevalences and their 95% confidence intervals. I have checked the examples provided in the manual but I cannot find a solution.
What would be the most elegant way to proceed?
Thanks in advance,
Romain
Comment