Announcement

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

  • Data analysis with multiple conditions

    Hello,

    I am trying to replicate this specific table (beginning on the Percentage male line) on Stata but can't seem to get it right. For that first line, I need to calculate the percentage of high earners (highearn=1) that are male (male=1), before the increase (afchnge=0) and in Kentucky (ky=1 or mi=1). The number below that percentage is the standard error.

    It is worth mentioning that I am just a student and have started using Stata recently. Maybe this is easier done in Excel, but it doesn't hurt to ask.

    Thank you in advance.

    Click image for larger version

Name:	statatable.png
Views:	1
Size:	197.3 KB
ID:	1497121

  • #2
    Gustavo:
    if you post what you typed and what Stata gave you back (as per FAQ), it woud be helpful.
    Conversely (and as per FAQ again), reporting that some code/command/advice/whatever did not work as expected is extremely unhelpful, because no one can spot where the problem (if any) actually is.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Carlo,

      I have tried a few table, tabulate and tabstat commands but none of them were any close. I was just experimenting. I have no idea how to even begin this. Sorry for my ignorance.

      Comment


      • #4
        Gustavo:
        due to the scant details provided, the trivial advice (that you can replicate for each variable) is:
        Code:
        summarize <whatyouwant> if highearn==1 & male==1 & afchnge==0 & ky==1
        For the othre levels of the categorical variables, as well as for Michigan, you should tweak the code as appropriate.

        As an aside, it's highly inefficient to maintain two categorical variables concerning Kentucky and Michigan when you can compact them in un unique dummy (see -help label-).
        Please also note that your query highlights that you need to get yourself familiar with the backbones of Stata (take a look for what you need at the Stata .pdf manual).
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X