Announcement

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

  • What test should I use to see whether two variables are significantly different from each other?

    Hi,

    Apologies for the rather basic question.

    I have one sample of participants. I have four different measures to calculate the percentage risk of developing a disease. All 4 measures are designed to calculate the exact same thing, however they have produced different results for my sample. I want to run a test to see whether the results of each measure are the same or significantly different from each other. The 4 measures are continuous variables and are a percentage.

    I hope that makes sense.

  • #2
    Edit: I just noticed that this is in the sandbox. This is the wrong place! You should post this to General. I'll repost there.

    This is a very interesting question. Normally, as you know, we have participants nested within two groups. We have the t-test or the t-test for proportions to see if the means (or proportions) of the groups differ. If we have more than two groups, we can use ANOVA to simultaneously test if any one group's mean differs from the rest.

    Here, I assume you actually have tests nested within participants. Despite that, my first inclination would still be (repeated measures) ANOVA. If this is the right approach, I think you would need to reshape your data such that each person has 4 observations, then run an ANOVA. Using some fake variable names:

    Code:
    preserve
    rename test_a prevalence_1
    ...
    rename test_d prevalence_4
    
    keep id prevalence_?
    reshape long prevalence, i(id) j(testnum)
    anova prevalence id, repeated(testnum)
    
    restore
    -preserve- and -restore- preserve the original data and restore it, so don't worry that you're throwing away a bunch of variables. You need to rename each test to some stub variable name ending in a number for reshape to work properly. The last command runs the ANOVA. You effectively have 4 repeated measures on each person. That's the approach that I think I would run, but I'm by no means certain it's correct.
    Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

    When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

    Comment


    • #3
      Thank you that is very helpful. I have reposted in the general to see if others concur

      Comment


      • #4
        Thank you for your message. What do I write in place of testnum and do I need to replace the ? where you wrote prevalence_?

        It says:
        Code:
         variable testnum not found
        (error in option repeated())
        Last edited by Joe Tuckles; 23 Aug 2018, 05:49.

        Comment

        Working...
        X