Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trend analysis

    Hello everyone
    I am using Nationwide Inpatient Sample for my research. I am looking for a trend in certain condition or procedure for example, trends of AFib in United states from 2003-20013. I am able to create trends to generate below mentioned baseline table with codes like

    svy: tab age year, row col
    svy: tab sex year, row col
    svy: tab race year, col row
    svy: tab diabetes year, col row
    svy: tab smoking year, col row

    This is the stata out put of above codes

    svy: tab newage year, col row
    (running tabulate on estimation sample)

    Number of strata = 226 Number of obs = 45143
    Number of PSUs = 6574 Population size = 213491.48
    Design df = 6348

    ----------------------------------------------------------------------------------------------
    | Calendar year
    newage | 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 Total
    ----------+-----------------------------------------------------------------------------------
    1 | .0789 .0695 .0907 .094 .0812 .1035 .109 .0962 .098 .0861 .0929 1
    | .0235 .0202 .0265 .0253 .021 .0254 .0277 .0252 .0245 .0231 .0237 .0242
    |
    2 | .0883 .0755 .0806 .089 .0952 .0962 .0932 .1 .0967 .0901 .0952 1
    | .0891 .0742 .0796 .081 .0833 .0797 .08 .0885 .0817 .0817 .0822 .0819
    |
    3 | .0724 .0744 .0761 .0846 .0909 .0993 .0947 .102 .1016 .0988 .1051 1
    | .2094 .2097 .2155 .2209 .228 .2359 .233 .2587 .246 .2571 .2601 .2348
    |
    4 | .0836 .0889 .0838 .0894 .096 .0967 .0956 .0882 .0958 .0891 .093 1
    | .3729 .3858 .3657 .3599 .371 .3543 .363 .3451 .3576 .3573 .3546 .362
    |
    5 | .0834 .0871 .0873 .0947 .0935 .1014 .0952 .088 .0947 .0853 .0893 1
    | .305 .3101 .3128 .3128 .2967 .3046 .2963 .2825 .2902 .2807 .2795 .297
    |
    Total | .0812 .0834 .0829 .0899 .0936 .0988 .0954 .0926 .097 .0903 .0949 1
    | 1 1 1 1 1 1 1 1 1 1 1 1
    ----------------------------------------------------------------------------------------------
    Key: row proportions
    column proportions

    Pearson:
    Uncorrected chi2(40) = 115.0889
    Design-based F(34.14, 2.2e+05)= 2.3005 P = 0.0000

    Note: strata with single sampling unit centered at overall mean.

    .
    . svy: tab female year, col row
    (running tabulate on estimation sample)

    Number of strata = 226 Number of obs = 45143
    Number of PSUs = 6574 Population size = 213491.48
    Design df = 6348

    ----------------------------------------------------------------------------------------------
    Indicator| Calendar year
    of sex | 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 Total
    ----------+-----------------------------------------------------------------------------------
    0 | .0773 .0788 .0828 .0874 .0935 .0986 .0984 .0952 .0976 .0929 .0974 1
    | .4534 .4497 .475 .4626 .4753 .4748 .491 .4896 .4792 .4896 .4885 .4759
    |
    1 | .0847 .0876 .0831 .0922 .0937 .099 .0927 .0901 .0964 .0879 .0926 1
    | .5466 .5503 .525 .5374 .5247 .5252 .509 .5104 .5208 .5104 .5115 .5241
    |
    Total | .0812 .0834 .0829 .0899 .0936 .0988 .0954 .0926 .097 .0903 .0949 1
    1 1 1 1 1 1 1 1 1 1 1 1
    ----------------------------------------------------------------------------------------------
    Key: row proportions
    column proportions

    Pearson:
    Uncorrected chi2(10) = 33.8803


    This is the outcome I get by using those codes which i have converted in a table to get better and easy explanation.

    Table 2 Baseline characteristics of study population, from
    Variable 2003 2004 2005 2006 2007 2008 2009 2010 2011 P-value for trends
    Overall 95062 11370 127207 143262 124210 119134 116941 94268 86457 <0.001
    Age(%)
    <65 36.8 35.7 36.4 38.5 37.8 38.4 37.6 39.2 38.8
    >=65 63.2 64.3 63.6 61.5 62.2 61.6 62.4 60.8 61.2
    Sex (%)
    Male 76.0 75.1 74.3 73.0 72.3 72.1 71.2 70.9 70.3 <0.001
    Female 24.1 24.9 25.7 27.0 27.7 27.9 28.8 29.1 29.7 <0.001
    Race (%)
    White 56.7 57.9 56.1 57.5 56.1 59.9 60.7 62.8 63.7 <0.001
    Black 6.4 7.5 6.8 8.7 10.3 10.3 11.0 13.7 14.4 <0.001
    Hispanics 4.5 3.9 5.1 5.1 5.9 4.9 6.1 6.0 6.7 <0.001
    Others 2.7 2.5 3.2 2.6 4.0 4.9 4.9 4.2 4.6
    Missing 29.7 28.2 28.7 26.1 23.6 19.9 17.3 13.3 10.6 <0.001

    But how can I create Table 2, where there is a trend of specific variable for example here is a mortality trend among all population.
    Table 2: In-hospital mortality (>60yrs of age) for Aortic Valve Disorders in US
    Year 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 Relative Change P-value for Trend
    Overall 4.53% 4.5% 3.86% 4.64% 4.29% 3.77% 3.74% 3.62% 4.32% 3.2% 3.34% 3.41% 3.46% -30.92% <0.001
    Age(years)
    60-69 2.56% 2.59% 2.03% 3.14% 2.73% 1.99% 2.32% 2.55% 2.37% 1.76% 2.3% 1.7% 2.26% -13.27% <0.001
    70-79 4.03% 4.43% 3.51% 4.24% 4.31% 3.58% 3.63% 3.02% 3.98% 3.08% 3.33% 3.22% 3.19% -26.33% <0.001
    >80 6.65% 5.86% 5.62% 6.17% 5.32% 5.23% 4.87% 4.97% 5.85% 4.29% 4% 4.59% 4.35% -52.87% <0.001
    Male 3.83% 3.81% 3.34% 4.28% 3.67% 3.5% 3.33% 3.33% 3.91% 3.18% 2.94% 3.16% 3.41% -12.32% <0.001
    Female 5.33% 5.28% 4.47% 5.06% 5.03% 4.11% 4.23% 4% 4.83% 3.22% 3.85% 3.73% 3.53% -50.99% <0.001
    Non-hispanic Whites 4.45% 4.61% 3.85% 4.34% 4.22% 3.84% 3.74% 3.44% 4.4% 3.15% 3.3% 3.42% 3.39% -31.27% <0.001
    Others 4.5% 5.72% 4.08% 4.24% 5.32% 2.98% 3.29% 3.76% 4.17% 2.4% 3.42% 3.78% 3.67% -22.62% <0.001


    In above table first row showed percentage of mortality among all cases diagnosed with aortic valve disease in that specific year and subsequent rows showed mortality in different age group, sex, gender and so forth.

    So I don't know what kind of code i can use to generate this second table and to get relative change.

    Thanks.

















  • #2
    I think this was previously posted in precisely the same format. You'll increase your chances of a helpful answer if you follow the FAQ on asking questions.

    The problem is partially that the question is not clear, and partially that you're asking for what may be a number of different things at once.

    Don't waste our time and your time posting the same thing repeatedly.

    Comment


    • #3
      I think these one was more detailed post then previous one. But there is some limitation in stata so not everyone know how to get second tables. In SAS as long as I know it's much easier.
      Thanks for your reply.

      Comment


      • #4
        Phil asked you here to post an excerpt from your data and to explain how you expect it to be transformed. It is easier to help if you give us some data to experiment with. I would also like to reiterate his advice to read the FAQ.

        Comment

        Working...
        X