Announcement

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

  • crossover analysis

    Hi everyone
    I have a question about crossover trial analysis.
    As an example, I want to use "pkdata3" data and analysis cross over (to see this data please type "webuse pkdata3" in command box in stata).
    To analysis crossover, I use "pkcross outcome, param(2)" command. Furthermore I do this analysis with SPSS (from: analyze, General linear model, univariate) and get its result.
    In SPSS I enter id variable as covariate because my observations are paired. when I compare stata results with SPSS results, I find the results are different from each other. because in SPSS I entered id variable as covariate and if I do not consider the id variable as covariate, the result will be the same. I know that considering id variable as covariate is correct. would you please tell me how consider this id variable in stata to get the same result?
    Attached Files

  • #2
    Originally posted by Amir Jabbari View Post
    In SPSS I enter id variable as covariate because my observations are paired. when I compare stata results with SPSS results, I find the results are different from each other. because in SPSS I entered id variable as covariate
    When you specified the model in SPSS, you erred in specifying the ID variable as continuous. It should be specified as categorical (nominal).

    would you please tell me how consider this id variable in stata to get the same result?
    You can similarly mis-specify the model in Stata.
    Code:
    use "http://www.stata-press.com/data/r12/pkdata3.dta"
    anova outcome c.id treat##period
    The result is identical to what you show for SPSS (and just as erroneous).


    By the way,
    Code:
    webuse pkdata3
    results in an error

    file https://www.stata-press.com/data/r17/pkdata3.dta not found
    r(601);


    in the current version of Stata.

    Comment


    • #3
      Dear Joseph Coveney thanks for your helpful explanation.
      First, I don't know why I should enter id variable as categorical?
      Second, I know that by using anova command I can get the same result, I want to know how I can get the same result with pkcross command. In fact pkcross is a command to analyze crossover experiments although its based on analysis of variance.
      And third, "webuse pkdata3" runs correctly (in my software: Stata/SE 14.2) and I don't know why it is in an error in your version.
      Anyway, thank you for your valuable answers.

      Comment


      • #4
        Originally posted by Amir Jabbari View Post
        First, I don't know why I should enter id variable as categorical?
        Because it's a variable of categorical data. The values of ID are nominal.

        Second, . . . I want to know how I can get the same result with pkcross command.
        You cannot. It won't permit you to mis-specificy the ID variable as continuous.

        Such a statistical model is nonsensical. Why do you want to fit it?

        And third, "webuse pkdata3" runs correctly (in my software: Stata/SE 14.2) and I don't know why it is in an error in your version.
        It's because by default Stata has webuse call its version's example datasets, and more recent versions of Stata apparently no longer use that example dataset for illustration of the pk suite of commands. The point I was trying to make is that, if you're not using the current version of Stata, then according to the forum's FAQ that I linked to you need to specify your version of Stata when you initially post.

        Comment

        Working...
        X