Skip to content
Prev 135059 / 398498 Next

OR estimate

"sigalit mangut-leiba" <smangut at gmail.com> wrote in
news:c99f7100801270318q7628e394p65cc6b9ff55a3e82 at mail.gmail.com:
Things.you.should.learn<-c("Read the posting guidelines",
       "When asking question ... specify the package being used", 
       "Use str() to figure the inner details of objects",
       "Provide examples")
$data
                  Outcome
Tap water exposure Control Case Total
      Lowest            29    2    31
      Intermediate      64   35    99
      Highest            6   12    18
      Total             99   49   148

$measure
                  odds ratio with 95% C.I.
Tap water exposure  estimate    lower    upper
      Lowest        1.000000       NA       NA
      Intermediate  7.355436 2.028317  51.3340
      Highest      24.991793 5.139475 210.8298

$p.value
                  two-sided
Tap water exposure   midp.exact fisher.exact   chi.square
      Lowest                 NA           NA           NA
      Intermediate 1.018658e-03 0.0012611784 1.857572e-03
      Highest      1.357958e-05 0.0000131817 6.858659e-06

$correction
[1] FALSE

attr(,"method")
[1] "median-unbiased estimate & mid-p exact CI"
List of 4
 $ data      : num [1:4, 1:3] 29 64 6 99 2 35 12 49 31 99 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ Tap water exposure: chr [1:4] "Lowest" "Intermediate" 
"Highest" "Total"
  .. ..$ Outcome           : chr [1:3] "Control" "Case" "Total"
 $ measure   : num [1:3, 1:3]  1.00  7.36 24.99    NA  2.03 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ Tap water exposure      : chr [1:3] "Lowest" "Intermediate" 
"Highest"
  .. ..$ odds ratio with 95% C.I.: chr [1:3] "estimate" "lower" "upper"
 $ p.value   : num [1:3, 1:3]       NA 1.02e-03 1.36e-05       NA 
1.26e-03 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ Tap water exposure: chr [1:3] "Lowest" "Intermediate" 
"Highest"
  .. ..$ two-sided         : chr [1:3] "midp.exact" "fisher.exact" 
"chi.square"
 $ correction: logi FALSE
 - attr(*, "method")= chr "median-unbiased estimate & mid-p exact CI"
# Now that you know that ORtbl os a list with 4 elements,
# assing that list to a new object and it will be simpler
odds ratio with 95% C.I.
Tap water exposure  estimate    lower    upper
      Lowest        1.000000       NA       NA
      Intermediate  7.355436 2.028317  51.3340
      Highest      24.991793 5.139475 210.8298
[1] NA
num [1:3, 1:3]  1.00  7.36 24.99    NA  2.03 ...
 - attr(*, "dimnames")=List of 2
  ..$ Tap water exposure      : chr [1:3] "Lowest" "Intermediate" 
"Highest"
  ..$ odds ratio with 95% C.I.: chr [1:3] "estimate" "lower" "upper"
[1] 1
estimate    lower    upper 
       1       NA       NA
[1] 7.355436
[1] 7.355436
[1] NA
Lowest Intermediate      Highest 
    1.000000     7.355436    24.991793 

#So you want the first column of the second row of the measure list:
[1] 7.355436