[R] prop.trend.test issue

Bernardo Rangel tura tura at centroin.com.br
Mon Dec 4 10:05:27 CET 2006


At 03:55 AM 12/3/2006, Ethan Johnsons wrote:
>I have the clinical study data.
>
>                                            Year 0       Year 3
>Retinol (nmol/L)        N       Mean +-sd       Mean +-sd
>Vitamin A group         73      1.89+-0.36      2.06+-0.53
>Trace group                57      1.83+-0.31     1.78+-0.30
>
>where N is the number of male for the clinical study.
>
>I want to test if the mean serum retinol has increased over 3 years
>among subjects in the vitamin A group.


If  You desire check mean serum retinol has increased over 3 years in 
vitamin A group.
You may use t.test
Look this example:

#Generate random Data

set.seed(123)
VitA1<-rnorm(73,1.89,.36)
Trace1<-rnorm(57,1.83,0.31)
VitA2<-rnorm(73,2.06,.53)
Trace2<-rnorm(57,1.78,0.30)

# Calculate diference Year 3 - Year 0

dVitA<-VitA2-VitA1
dTrace<-Trace2-Trace1

# Testing diference
t.test(dVitA,dTrace)


         Welch Two Sample t-test

data:  dVitA and dTrace
t = 2.2762, df = 117.746, p-value = 0.02464
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
  0.02756874 0.39659494
sample estimates:
   mean of x   mean of y
  0.15905162 -0.05303022





Bernardo Rangel Tura, MD, Phd
National Institute of Cardiology Laranjeiras
Rio de Janeiro Brazil




More information about the R-help mailing list