Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Plotting stored estimates


From   Sara Mottram <[email protected]>
To   [email protected]
Subject   st: Plotting stored estimates
Date   Tue, 08 Aug 2006 17:01:54 +0100

Apologises if this is a basic question.
I have a binary variable kcons which indicates whether or not the person has consulted their doctor about knee pain and another variable age_cat, indicating the age group to which the person belongs.
I have calculated the mean of kcons within each level of age_cat using -mean- with the -over()-, option to get the probability of consulting with knee pain in each age group. I have then saved these estimates using -estimates store-.
I would now like to produce a scatter plot the proportion of people who consult in each category against age_cat to assess whether there is a trend.
This sounds like it should be straightforward but I can't work out from the manuals (I have looked under _estimates in the programming manual) and I can't find anything in the FAQs about how to do this. If I try scatter _est age_cat, I get a flat plot. I could of course produce a plot in Excel by typing in the results of -mean-, but I feel that this is probably an important feature that I should learn to use properly?
I have included my code and out put below.
Sara

. mean kcons, over(age_cat)

Mean estimation Number of obs = 742

_subpop_1: age_cat = 50-54
_subpop_2: age_cat = 55-59
_subpop_3: age_cat = 60-64
_subpop_4: age_cat = 65-69
_subpop_5: age_cat = 70-74
_subpop_6: age_cat = 75-79
_subpop_7: age_cat = 80+

--------------------------------------------------------------
Over | Mean Std. Err. [95% Conf. Interval]
-------------+------------------------------------------------
kcons_p18m |
_subpop_1 | .2911392 .0514379 .1901578 .3921207
_subpop_2 | .2205882 .0356868 .1505289 .2906475
_subpop_3 | .221374 .036413 .1498892 .2928589
_subpop_4 | .3164557 .0371185 .2435858 .3893256
_subpop_5 | .2605042 .0404049 .1811825 .3398259
_subpop_6 | .3766234 .0555805 .2675095 .4857373
_subpop_7 | .4047619 .0766573 .2542706 .5552532
--------------------------------------------------------------

. estimates store propnknee
. plot _est age_cat

2 + e | s | a | m | p | l | e | ( | ) | | f | * * * * * * *
r | o | m | | e | s | t | i | 0 + +----------------------------------------------------------------+
1 age_cat 7



*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index