Announcement

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

  • Graphing "mean" predicted probabilities by gender

    Dear Statalist members,

    I would like to graph "mean" predicted probabilities that correspond to each age.
    On Y axis, I need mean predicted probabilities of females (mean of those : plosfemale0 plosfemale1 plosfemale2 plosfemale3) and males (plosmale0 plosmale1 plosmale2 polsmale3). As you can predict, plosmale0 stands for predicted probability of males who in age 0. Hoever, in my dataset, there are 207000 males aged 0. That is why I try to graph the mean of predicted probability.). In sum, on Y axis, I would like to see mean predicted probabilities of males and females.
    On X axis, I need age variable from 0 to 3 (normally my age variable is between 0 and 58 but for just an example I put them from 0 to 3)

    Normally I can see the mean probabilities by typing sum plosfemale0 plosfemale1 plosfemale2 plosfemale3 plosmale0 plosmale1 plosmale2 polsmale3. However, I cannot put these values onto graph.

    I could not do this. Can anybody please help me?



    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(age_months polsmale0 polsmale1 polsmale2 polsmale3 polsfemale0 polsfemale1 polsfemale2 polsfemale3) str15 CASEID
     0 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
     1 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
     2 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
     3 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
     4 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
     5 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
     6 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
     7 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
     8 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
     9 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
    10 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
    11 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
    12 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
    13 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
    14 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
    15 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
    16 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
    17 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
    18 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
    19 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
    20 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
    21 .9826388 .9858013 .9724659 .9405161 .9644952 .9511299 .9236608  .880961 "       10110  2"
     0  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
     1  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
     2  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
     3  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
     4  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
     5  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
     6  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
     7  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
     8  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
     9  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    10  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    11  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    12  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    13  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    14  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    15  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    16  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    17  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    18  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    19  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    20  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    21  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    22  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    23  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    24  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    25  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    26  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    27  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    28  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    29  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    30  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    31  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    32  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    33  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    34  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    35  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    36  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    37  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    38  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    39  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    40  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    41  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    42  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    43  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    44  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    45  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    46  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    47  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    48  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    49  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    50  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    51  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    52  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    53  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    54  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    55  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    56  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    57  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    58  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
    59  1.00206 .9999139 .9944419 .9822583 .9032698 .9046313 .9022552 .9110834 "       102 3  2"
     0 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
     1 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
     2 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
     3 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
     4 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
     5 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
     6 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
     7 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
     8 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
     9 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
    10 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
    11 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
    12 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
    13 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
    14 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
    15 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
    16 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
    17 .9796483 .9577594 .9287624 .9081257 .9771457 .9744409 .9471653 .9175682 "       10217  1"
    end
    Last edited by Cansu Oymak; 04 Jun 2021, 03:45.
Working...
X