Introduction


Inferential statistics: Comparing two or more groups, continuous and categorical outcomes.

This module will introduce the concepts of estimation and null-hypothesis statistical significance testing. In addition sample size and power calculations will be covered, and Type I and Type II error.

Our approach based on PPDAC:

Problem

At the time of the initiation of the Framingham study it was not clear the role of blood pressure played in the risk of stroke, as blood pressure was thought to naturally increase with age. Therefore, in terms of assessing the risk of stroke is relationship to increasing blood pressure, a cohort study design is the most suitable design. Importantly, it would be un-ethical to randomise individuals to high blood pressure, and a prospective cohort of individuals, without stroke at baseline, among whom blood pressure can be measured, and then follow-up for an incident stroke. Our approach will be to refer to blood pressure as our study factor and stroke as our study outcome.

Population

Adults with (exposed) and without high (un-exposed/comparator/counter factorial) blood pressure.

Data

Baseline blood pressure and follow stroke incidence.

Analysis

Hypothesis testing and estimation.

Null Hypothesis Significance Testing (NHST) comparing the rates of stroke between hypertensive and non-hypertensive study participants.

The NHST approach includes the stating of the null-hypothesis (\(H_0\)) (no-effect). In other would no association between the study factor and study outcome:

\(H_0\) The rate of stroke among HT \(=\) rate among non-HT.

In contrast to the null-hypothesis, an alternate hypothesis (\(H_i\)) is define:

\(H_i\) The rate of stroke among HT \(\neq\) rate among non-HT.

Then a critical value is set, say from a z-statistic (i.e > 1.96 upper 2.5% tail), or the case of the chi-squared test statistic (\(\chi^2\)) > 3.84 (\(1.96^2\)).

To assess the potential role of chance when comparing the frequencies of a two-by-two table of stroke yes/no and HT yes/no, the Pearson’s chi-squared test is commonly used. It is based on comparing the difference between the observed (O) table cell frequencies and what would be expected (E) by chance. The specific statistic being the sum of these differences:

\(\chi^2 = \sum{\frac{(O-E)^2}{E}}\)

Commonly the approach of squaring an subtraction of two values is seen in statistics, this is a trick statisticians use to remove negative values! And, the expected values of each given cell is estimated using the row and column totals:

\(E = \frac{(total_{row} \times total_{column})}{Total_N}\)

Estimation of effect (Rate Ratio, Odds Ratio and Incidence Rate Ratio).

SPSS Code:

* Cross tabulation and chisq test .
CROSSTABS TABLES =  stroke BY prevhyp
                    /CELLS=COUNT ROW
                    /STATISTICS=CHISQ.
EXECUTE.    

SPSS OUTPUT

. . HT no-HT. Total
stroke No Count. 2806 1057 3863.
. . % within prevhyp 94.7% 85.0% 91.8%
. Yes Count 157 186 343.
. % within prevhyp 5.3% 15.0%. 8.2%
Total Count. 2963 1243 4206.
. % within prevhyp 100% 100% 100.0%.

Chi-Square Tests

Value. df Asymptotic Significance (2-sided) Exact Sig. (2-sided) Exact Sig. (1-sided)
Pearson Chi-Square 109.211\(^a\) 1 <.001
Continuity Correction\(^b\) 107.925 1 <.001
Likelihood Ratio 99.456. 1 <.001
Fisher’s Exact Test . <.001 <.001.
Linear-by-Linear Association. 109.185. 1 <.001
N of Valid Cases 4206.

note: \(^a\) 0 cells (0.0%) have expected count less than 5. The minimum expected count is 101.37.
\(^b\) Computed only for a 2x2 table

## Input object size:    511024 bytes;   22 variables    4206 observations
## New object size: 501112 bytes;   22 variables    4206 observations
##  --------------------------------------------------- 
##  sysHT          N  Stroke  Stroke  Stroke follow-up  
##                       (n)     (%)  (rate)    (Total  
##                                              years)  
##  --------------------------------------------------- 
##  No      2963.000 157.000   5.299   2.481 63293.676  
##  Yes     1243.000 186.000  14.964   8.363 22239.628  
##                                                      
##  Total   4206.000 343.000   8.155   4.010 85533.303  
##  ---------------------------------------------------
##       No      Yes 
## 63293.68 22239.63
##     Strokes    N
## No      157 2963
## Yes     186 1243
##   events total probability         se exact.lower95ci exact.upper95ci
## 1    157  2963  0.05298684 0.00411525      0.04519247      0.06167668
## 2    186  1243  0.14963797 0.01011783      0.13024489      0.17070700
##     Strokes    n
## No      157 2806
## Yes     186 1057
##   events person.time  incidence          se exact.lower95ci exact.upper95ci
## 1    157        2806 0.05595153 0.004465418      0.04750285      0.06546329
## 2    186        1057 0.17596973 0.012902726      0.15150993      0.20324503
##              Exposed +    Exposed -      Total
## Outcome +          186         1057       1243
## Outcome -          157         2806       2963
## Total              343         3863       4206
## 
## Point estimates and 95% CIs:
## -------------------------------------------------------------------
## Inc risk ratio                                 1.98 (1.78, 2.21)
## Odds ratio                                     3.15 (2.51, 3.93)
## Attrib risk in the exposed *                   26.87 (21.41, 32.32)
## Attrib fraction in the exposed (%)            49.54 (43.68, 54.80)
## Attrib risk in the population *                2.19 (0.22, 4.16)
## Attrib fraction in the population (%)         7.41 (5.72, 9.07)
## -------------------------------------------------------------------
## Uncorrected chi2 test that OR = 1: chi2(1) = 109.211 Pr>chi2 = <0.001
## Fisher exact test that OR = 1: Pr>chi2 = <0.001
##  Wald confidence limits
##  CI: confidence interval
##  * Outcomes per 100 population units
##     Strokes     pyrs
## No      157 63293.68
## Yes     186 22239.63
##   events person.time   incidence           se exact.lower95ci exact.upper95ci
## 1    157    63293.68 0.002480501 0.0001979655     0.002105945     0.002902186
## 2    186    22239.63 0.008363449 0.0006132379     0.007200930     0.009659784
##              Outcome +    Time at risk        Inc rate *
## Exposed +          186           22240             0.836
## Exposed -          157           63294             0.248
## Total              343           85533             0.401
## 
## Point estimates and 95% CIs:
## -------------------------------------------------------------------
## Inc rate ratio                                 3.37 (2.71, 4.20)
## Attrib rate in the exposed *                   0.59 (0.46, 0.71)
## Attrib fraction in the exposed (%)            70.34 (63.12, 76.17)
## Attrib rate in the population *                0.15 (0.10, 0.21)
## Attrib fraction in the population (%)         38.14 (34.94, 41.40)
## -------------------------------------------------------------------
##  Wald confidence limits
##  CI: confidence interval
##  * Outcomes per 100 units of population time at risk

Null Hypothesis Significance Testing (NHST) comparing the mean systolic blood pressure of between stroke and non-stroke study participants.

The NHST approach includes the stating of the null-hypothesis (\(H_0\)) (no-effect). In other would no association between the study factor and study outcome:

\(H_0\) Mean systolic BP among non-stroke \(=\) Mean systolic BP among stroke.

In contrast to the null-hypothesis, an alternate hypothesis (\(H_i\)) is define:

\(H_i\) Mean systolic BP among non-stroke \(\neq\) Mean systolic BP among stroke.

Then a critical value is set, say from a z-statistic (i.e 1.96, < 2.5% tail). Comparing the means of two groups - Student’s T-Test. To assess the potential role of chance when comparing the mean systolic blood pressure at baseline, between the stroke yes and stroke no study participants, we will use a t-test, formally known as Student’s t-test, as William S. Gosset 1 at the time of publishing this method was employee of the Head Brewer of Guinness, his employer’s policy in publishing research results at that time prevented him from using his real name. Student’s t-test essentially is the ratio of the difference between the two group mean weighted by an estimate of error of this comparison. If we let the two group means be expressed as \(\bar{x_1}\) and \(\bar{x_2}\), repestively, the test statistic is estimates as:

\(t = \frac{\bar{x_1} - \bar{x_2}}{SE(\bar{x_1} - \bar{x_2})}\)

Where, \(SE(\bar{x_1} - \bar{x_2})\) is a summary standard error of both the means, using the sample size and SD of the groups. However, there is two version, one based on assuming and equal variance (\(SD^2\) or \(\sigma^2\)), and the other unequal variance. The former being:

\(SE(\bar{x_1} - \bar{x_2}) = \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}\)

SPSS Code:

MEANS TABLES = sysbp BY stroke
  /CELLS=COUNT MEAN STDDEV MEDIAN.
  
* Creat histograms.
EXAMINE VARIABLES = sysbp 
      /PLOT HISTOGRAM.


EXAMINE VARIABLES=sysbp BY stroke
  /PLOT=BOXPLOT
  /STATISTICS=NONE
  /NOTOTAL.

EXECUTE.

SPSS Output Report sysbp

stroke N Mean Std. Deviation Median
No 3863 130.597 20.5604 127.000
Yes 343 143.711 25.9166. 139.000
Total 4206 131.666 21.3485. 128.000

R Output

SPSS Code

* T-test mean SBP between stroke Yes and Stroke No participants.
T-TEST GROUPS=stroke(0,1)
  /MISSING=ANALYSIS
  /VARIABLES=sysbp 
  /CRITERIA=CI(.95).

SPSS Output

Independent Samples Test
Levene’s Test for Equality of Variances —— t-test for Equality of Means

F Sig. t df One-Sided p Two-Sided p. Mean Difference Std. Error Difference 95% CI of the Difference
sysbp Equal variances assumed 31.316 <.001 -11.060 4204. <.001 <.001 -13.1147 1.1858 -15.4395 to -10.7899.
Equal variances not assumed . -9.121 381.186 <.001 <.001 -13.1147 1.4379 -15.9420 to -10.2874.

When using the R t-test function we can choose between the two by using the subcommand ‘var.equal’ T/F. Given the equal SD and therefore variance of age between women and men, we will include TRUE.

R Output

## 
##  Two Sample t-test
## 
## data:  sysbp by stroke
## t = -11.06, df = 4204, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -15.43951 -10.78986
## sample estimates:
## mean in group 0 mean in group 1 
##        130.5967        143.7114
## 
##  Welch Two Sample t-test
## 
## data:  sysbp by stroke
## t = -9.1205, df = 381.19, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -15.94196 -10.28741
## sample estimates:
## mean in group 0 mean in group 1 
##        130.5967        143.7114

Using a linear regression model

## 
## Call:
## lm(formula = sysbp ~ stroke, data = d)
## 
## Residuals:
## Systolic BP [mmHg] 
##     Min      1Q  Median      3Q     Max 
## -49.711 -14.597  -3.597  10.903 151.289 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 130.5967     0.3386  385.66   <2e-16 ***
## stroke       13.1147     1.1858   11.06   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 21.05 on 4204 degrees of freedom
## Multiple R-squared:  0.02827,    Adjusted R-squared:  0.02804 
## F-statistic: 122.3 on 1 and 4204 DF,  p-value: < 2.2e-16
## Linear regression predicting sysbp
##  
##                 Coeff.(95%CI)        P(t-test) P(F-test)
## stroke: 1 vs 0  13.11 (10.79,15.44)  < 0.001   < 0.001  
##                                                         
## No. of observations = 4206

Conclusion Study participants in the Framingham Heart Study who had a stroke during the following period were observed to have a higher average systolic blood pressure at baseline, 144 mmHg versus 131 mmHg, respectively (mean difference = 13.1 mmHg, 95%CI 10.8 to 15.4, p > 0.001).


  1. Student. The Probable error of a mean. Biometrika vol 6, no. 1, 1908 pp1-25↩︎