Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: NPTREND problem


From   Yongfei Wang <yongfei.wang@yale.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: RE: NPTREND problem
Date   Mon, 11 Nov 2002 12:02:48 -0500

Obviously you need to reshape your data into another form so that it
includes 452 observations, and then run nptrend command.

Yongfei

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of Paul O'Brien
Sent: Monday, November 11, 2002 11:36 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: NPTREND problem


I have not been able to get the table layout right to do a test for trend
(NPTREND) with the following data:

WEIGHT   EE20mcg EE30mcg
gained     48     24
stable    210    114
lost       38     18

What I get is this:

. tabi 48 24\210 114\38 18

           |          col
       row |         1          2 |     Total
-----------+----------------------+----------
         1 |        48         24 |        72
         2 |       210        114 |       324
         3 |        38         18 |        56
-----------+----------------------+----------
     Total |       296        156 |       452

          Pearson chi2(2) =   0.2483   Pr = 0.883

. list

          row       col           pop
  1.        1         1            48
  2.        1         2            24
  3.        2         1           210
  4.        2         2           114
  5.        3         1            38
  6.        3         2            18

. nptrend row, by(col)

       col     score       obs      sum of ranks
         1         1         3          10.5
         2         2         3          10.5

          z  =  0.00
  Prob > |z| =  1.00



The correct answer is:
One sided P = .2965
Two sided P = .593

Where am I going wrong?

Thanks

Paul

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index