Announcement

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

  • Performing qnorm-command (QQ-plot) by subgroup

    Hello
    I'm fairly new to STATA, and even though that I have researced this specifik topic, I can't seem to find the answer.
    If I want to perform af QQ-plot on the age of my participants, by the "qnorm" command, but I only want it for a specifik gender (sex = 1 or 0), how do I perform this qnorm for just a subgroup and not the total data-set? I have performed a Shapiro-Wilk-test (as I didn't have any luck with the qnorm, but the values seem off).

    Kind Regards
    Rasmus

  • #2
    Please note

    https://www.statalist.org/forums/help#stata

    https://www.statalist.org/forums/help#spelling

    qnorm allows if: see its help file. You can run this example to see some technique


    Code:
    sysuse auto
    qnorm mpg if foreign == 1
    qnorm mpg if foreign == 0
    That said, I wouldn't be surprised if ages of participants were not normally distributed. For example, I don't expect the ages of people here to be anything like normal. I don't expect many people under 18, I do expect many people under 35 and there is a long tail beyond that.

    But why do you think condition is of interest or importance?
    Last edited by Nick Cox; 30 Oct 2018, 11:50.

    Comment


    • #3
      Thank you for your reply, and for the corrections. I will run the example asap. Even though age might not be normally distributed, I think that I will have to test for normal distribution anyway before performing the parametrit or non-parametric T-test, because the QQ-plot generated of total dataset seems normally distributed, and I will need to run the test on other variables than just age, so even though age might not be the best example, I will need it for some of the other variables.

      kind regards

      Comment

      Working...
      X