Announcement

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

  • p-trend VS nptrend

    HI ,

    I am trying to find differences between p-trend and np-trend especially for testing trend of a continuous variable across an ordinal group. I have read the stata page "http://www.stata.com/support/faqs/statistics/test-for-trend/" but still have some questions and was hoping to see if any members might help me.

    p-trend is a user written(by Patrick Royston).
    np-trend is a inbuilt stata command.

    Question:
    =======
    Can p-trend be used to test the trend for a continuous variable(such as mean systolic blood pressure) across an ordinal group.

    The help file says that it calculates proportions of the categorical variable across an ordinal variable.

    I am aware that np-trend can be used to test trend for (continuous or an ordinal variable) across another ordinal variable.

    But the beauty of p-trend test is that it gives two statistics .
    ---First test statistic(chi2 for trend):tests if there is a association.
    ---Second test statistic(chi2 for departure) tests if there is departure from linearity.

    Where as in np-test: we get only one test statistics: which tests for association/trend. We cannot test if the trend is linear OR non-linear.

    I thank you again for your time.

    Thank you,
    Lucas


  • #2
    since -ptrend- requires 3 variables and your model for the continuous variable cannot have 3 variables unless you categorize things (bad idea), then the answer is "no"; if you use linear regression with dummy (indicator) variables for the ordinal grouping you will have what you want (though you may want to add a posthoc test for linearity); you could even treat the ordinal grouping as a single variable (which will enforce linearity) and then compare the two models; note, since the covariate (predictor) is ordinal, you could use cascading dummies if you wanted: search cascade

    Comment


    • #3
      hi,

      Thank you very much for the information.

      Yes, as my model as only two variables, p-trend cannot be used.I prefer not to convert it to categorical data.

      I could not understand the following sentences. Can you please explain/educate preferably with an example. Sorry if I am taking too much of your time.

      "if you use linear regression with dummy (indicator) variables for the ordinal grouping you will have what you want (though you may want to add a posthoc test for linearity); you could even treat the ordinal grouping as a single variable (which will enforce linearity) and then compare the two models; note, since the covariate (predictor) is ordinal, you could use cascading dummies if you wanted: search cascade "

      Thank you very much for your time.
      Lucas

      Comment


      • #4
        what part or parts are not clear to you?

        here are some examples using the auto data set (sysuse auto):

        regress gear i.rep78 v. regress gear rep78

        Comment

        Working...
        X