Daniel- Biostatistics
1. Introduction to biostatistics and basic concepts (part 1)
This section of the study guide introduces the foundational statistical concepts, terminology, and the integral role of biostatistics within health sciences research, laying the groundwork for subsequent statistical analysis and inference.
1.1 Introduction to biostatistics
Biostatistics is a discipline concerned with the collection, organization, summarization, and analysis of data, as well as the drawing of inferences about a body of data from observing only a part of it. This field is crucial for health sciences, providing the tools to understand and interpret information derived from studies and experiments. The core objectives of studying biostatistics include learning to organize and summarize data (descriptive statistics) and making decisions about large datasets by examining smaller subsets (inferential statistics). Data, in this context, are numbers obtained from measurements or counts.
1.2 Some basic concepts
The study of statistics involves learning new terminology and understanding specialized meanings of familiar words. Key terms include:
- Data: The raw material of statistics, defined as numbers. These numbers can arise from measurements (e.g., patient weight) or counts (e.g., number of patients discharged).
- Statistics: A field of study encompassing the collection, organization, summarization, and analysis of data. It also involves the process of drawing inferences about a larger dataset based on a smaller observed portion. Statisticians are responsible for interpreting and communicating these findings.
Note: The information within data holds meaning, and biostatistics is the discipline dedicated to investigating and evaluating the nature and significance of this information 20.
1.3 Measurement and measurement scales
Understanding different types of variables and how they are measured is fundamental in biostatistics. This involves classifying data based on the nature of the measurements and the scales used.
- Variables: Characteristics or attributes that can take on different values.
- Measurement Scales: The levels at which variables can be measured. These scales dictate the types of statistical analyses that can be performed. The primary measurement scales include:
- Nominal Scale: Categorical data where categories have no inherent order (e.g., blood types: A, B, AB, O; or gender: Male, Female).
- Ordinal Scale: Categorical data where categories have a meaningful order or rank, but the distances between categories are not necessarily equal or quantifiable (e.g., disease severity: mild, moderate, severe; or patient satisfaction: poor, fair, good, excellent).
- Interval Scale: Numerical data where the order is meaningful, and the differences between consecutive values are equal and quantifiable. However, there is no true zero point, meaning ratios are not meaningful (e.g., temperature in Celsius or Fahrenheit).
- Ratio Scale: Numerical data that possess all the properties of interval scales, plus a true zero point. This allows for meaningful ratios between values (e.g., height, weight, age, number of patients).
Important: The choice of measurement scale is critical as it determines the appropriate statistical methods for analysis. Ratio scale data offer the most flexibility for statistical analysis.
1.4 Sampling and statistical inference
A significant objective in biostatistics is to draw conclusions about a large group (population) by studying a smaller, representative subset (sample).
- Population: The entire group of individuals, objects, or measurements that we are interested in studying.
- Sample: A subset of the population from which data are collected.
- Sampling: The process of selecting a sample from a population.
- Statistical Inference: The process of using data from a sample to make generalizations or draw conclusions about the characteristics of the population from which the sample was drawn.
Remember: The goal of statistical inference is to make informed decisions about a population based on limited sample data. A well-selected sample is crucial for valid inferences.
Scientific sampling
To ensure that inferences drawn from a sample are valid, scientific methods of sampling are employed. These methods aim to obtain a sample that is representative of the population.
- Simple Random Sample: A sample in which every possible sample of a given size has an equal chance of being selected. This is often considered the ideal, though not always practical, sampling method.
- Other Scientific Samples: Various other sampling techniques exist, such as systematic sampling, stratified sampling, and cluster sampling, each designed to improve representativeness or efficiency under specific circumstances. The selection of a sampling method depends on the research question and the characteristics of the population.
1.5 The scientific method and the design of experiments
Biostatistics plays a vital role in the scientific method, which is a systematic approach to acquiring knowledge. The design of experiments is a key component of this method, ensuring that data collected are both valid and interpretable.
- Scientific Method: A logical and systematic approach to problem-solving that typically involves:
- Observation and question formulation.
- Hypothesis generation.
- Experimentation or data collection.
- Data analysis.
- Conclusion drawing.
- Design of Experiments: The process of planning and conducting studies in a way that allows for the efficient and unbiased collection of data to answer specific research questions. This involves defining the variables, treatments, experimental units, and the procedures for data collection.
Tip: A well-designed experiment minimizes bias and confounding factors, leading to more reliable conclusions.
1.6 Computers and biostatistical analysis
The advent and widespread availability of computers have revolutionized biostatistical analysis. They offer significant advantages in terms of speed, accuracy, and the ability to handle complex calculations.
- Data Management: Computers facilitate the efficient entry, storage, and organization of large datasets.
- Computational Power: Statistical software packages (e.g., SAS, SPSS, R, MINITAB) can perform complex analyses rapidly, which would be time-consuming or practically impossible to do manually.
- Accuracy: Automated calculations reduce the likelihood of human error in complex statistical procedures.
- Visualization: Computers enable the creation of graphs and charts to visually represent data and results, aiding in understanding and communication.
Important: While computers are powerful tools, a thorough understanding of statistical principles is still necessary to select appropriate methods, interpret results correctly, and avoid misapplication of software capabilities 19.
2. Introduction to biostatistics and basic concepts (part 2)
This section delves into essential statistical concepts, including data sources, variable types, measurement scales, sampling methodologies, the scientific method, and the role of statistical inference in health sciences research.
2.1 Sources of data and variables
Statistical analysis is driven by the need to answer specific questions, and the raw material for this process is data, which can be obtained from several sources: routinely kept records, surveys, experiments, and external sources such as published reports or data banks 21.
A variable is a characteristic that can take on different values among individuals, places, or things. Variables are categorized based on the nature of their measurement:
- Quantitative variables can be measured numerically and convey information about amount. Examples include height, weight, and age.
- Qualitative variables are characterized by categories rather than numerical measurement. Measurement for qualitative variables involves categorization, and analysis often relies on counting frequencies within these categories. An example is a medical diagnosis.
Variables can also be classified based on their randomness and the values they can assume:
- A random variable is a variable whose values arise from chance factors and cannot be predicted with certainty.
- A discrete random variable is characterized by gaps or interruptions in the values it can assume, meaning it can only take on specific, separate values, typically whole numbers. For instance, the number of daily hospital admissions is discrete.
- A continuous random variable can assume any value within a specified interval, without gaps. Examples include height and weight, although in practice, measurements of continuous variables are often recorded to a certain degree of precision, making them appear discrete 22.
Note: While continuous variables can theoretically take on infinite values within an interval, practical limitations of measuring instruments mean observed values are recorded discretely.
2.2 Populations and samples
- A population is defined as the largest collection of entities for which there is an interest at a particular time. This collection can consist of people, animals, machines, places, or cells. A population of values comprises all possible values of a random variable within that collection.
- A sample is simply a part of a population.
Important: The definition of a population is determined by the scope of interest; a smaller subset of interest within a larger group constitutes a different population 23.
2.3 Measurement scales
Measurement is defined as the assignment of numbers to objects or events according to a set of rules. Different sets of rules result in different measurement scales, each with distinct properties:
- Nominal scale: This is the lowest level of measurement, used for "naming" observations or classifying them into mutually exclusive categories. Numbers assigned are merely labels for distinct categories. Examples include gender (male/female) or medical diagnoses.
- Ordinal scale: Observations can be ranked or ordered according to a criterion. While categories are distinct and ordered, the differences between adjacent categories are not necessarily equal. Examples include patient recovery status (unimproved, improved, much improved) or socioeconomic status (low, medium, high).
- Interval scale: This scale allows for ordering of measurements, and the distance between any two measurements is known and equal. It uses a unit of distance and an arbitrary zero point that does not necessarily indicate the complete absence of the quantity being measured. Temperature (Celsius or Fahrenheit) is a classic example.
- Ratio scale: This is the highest level of measurement, characterized by the equality of intervals and the equality of ratios. It possesses a true zero point, indicating the absence of the quantity. Measurements like height, weight, and length use the ratio scale 24.
| Scale | Properties | Examples |
|---|---|---|
| Nominal | Classification into categories | Gender, blood type, race |
| Ordinal | Categories can be ranked | Likert scale (strongly agree to strongly disagree), disease severity |
| Interval | Equal intervals between values; arbitrary zero | Temperature (°C or °F), IQ scores |
| Ratio | Equal intervals; true zero point; ratios meaningful | Height, weight, age, income |
2.4 Sampling and statistical inference
Statistical inference is the process of drawing conclusions about a population based on information from a sample drawn from that population. To make valid inferences, scientific samples are required.
- Simple random sample: A sample of size n drawn from a population of size N where every possible sample of size n has an equal chance of being selected.
- Simple random sampling is the procedure for selecting such a sample.
- Sampling with replacement means a member is returned to the population after selection and can be chosen again.
- Sampling without replacement means a member, once selected, is not returned to the population for subsequent draws. In practice, sampling is almost always done without replacement 25.
Reminder: Avoiding personal judgment and using objective procedures, like tables of random numbers, is crucial for ensuring true randomness in selection 26.
2.5 Alternative sampling methods
While simple random sampling is fundamental, other methods are employed:
- Systematic sampling: This method involves selecting a random starting point and then choosing every k-th record thereafter. It is commonly used with data stored in sequential files, such as medical records.
Example: To obtain a sample of 10 subjects from 189, one might select a random starting subject and then sample every 18th subject thereafter (k=18), as 185/10 is approximately 18.5 29.
- Stratified random sampling: The population is divided into subgroups (strata) based on shared characteristics. Then, random samples are drawn independently from each stratum. This method is useful when sample units within strata are more similar to each other than to units in other strata, potentially reducing variability in the sample.
- Stratified systematic sample: A variation where systematic sampling is used within each stratum.
- Stratified sampling proportional to size: The sample size from each stratum is adjusted to be proportional to the population size of that stratum, preventing overrepresentation of smaller strata.
Tip: Stratified random sampling is particularly beneficial when there are known differences between subgroups within a population that might affect the outcome of interest, ensuring better representation 30.
2.6 The scientific method and experimental design
The scientific method is a systematic process for collecting, analyzing, and reporting scientific information to produce unbiased, replicable results. It is an empirical approach based on data. Key elements include 31:
- Making an observation: Identifying a phenomenon or group of phenomena that leads to questions.
- Formulating a hypothesis: Proposing an explanation for the observation and making quantitative predictions. Hypotheses can be research hypotheses (descriptive) or statistical hypotheses (quantitative and testable).
- Designing an experiment: Creating a study to yield data that can validly test the statistical hypothesis. This step requires careful consideration of accuracy (correctness of measurement) and precision (consistency of measurement).
Important: Properly designed experiments are critical for valid results. Improper design is a leading cause of invalid conclusions, and statistical expertise is essential in this phase 32.
This section delves into the practical application of statistical principles in health sciences research, focusing on experimental design, the indispensable role of computers in analysis, and a summary of foundational concepts.
2.7 Experimental design and scientific inquiry
The design of research studies is fundamentally guided by the type of data required to test specific hypotheses. While data can be gathered through various means, experimentation stands as a primary method in scientific research. A true experimental design involves randomly assigning study subjects to either an experimental (treatment) group or a control group that does not receive the intervention. This methodology allows for the testing of cause-and-effect relationships, provided all other potential confounding factors are controlled. Statistical expertise is crucial for navigating the complexities of experimental designs, with specialized texts offering deeper insights. Ultimately, the conclusions drawn from research are rarely considered definitive; they necessitate replication and rigorous scientific scrutiny before widespread acceptance.
Note: A true experimental design enhances the ability to establish causality by comparing outcomes between groups that differ only in the presence or absence of the experimental manipulation.
2.8 Applying the scientific method in research design
The scientific method provides a structured framework for addressing research questions, encompassing hypothesis formulation, experimental design, data collection, and analysis to draw conclusions. For instance, when investigating the relationship between diet and weight loss, one would formulate a specific hypothesis, design an experiment (e.g., randomly assigning participants to different dietary interventions), collect data on weight changes, and statistically analyze the results to determine if the diet had a significant effect. Similarly, investigating the combined effects of diet and exercise would involve a more complex experimental design to isolate and assess the impact of each factor, or their interaction.
Example: To test the hypothesis that a low-carbohydrate diet leads to greater weight loss than a low-fat diet, an experiment could randomly assign 200 participants to either the low-carbohydrate or low-fat diet group for 12 weeks. Weight changes would be measured at the beginning and end of the study, and the average weight loss between the two groups would be statistically compared.
2.9 Computers and biostatistical analysis
The advent and widespread adoption of computers have profoundly transformed health sciences research, particularly in the realm of biostatistical analysis. Computers automate complex and time-consuming calculations, performing them with greater speed and accuracy than human technicians. This efficiency allows researchers to dedicate more effort to improving data quality and interpreting findings. The proliferation of microcomputers and sophisticated statistical software packages has further revolutionized the field.
Important: Computers significantly enhance the accuracy and speed of statistical computations, freeing up researcher time for more critical tasks like data interpretation.
2.10 Statistical software and random number generation
Numerous statistical software packages are available for personal computers, facilitating data analysis and visualization. These packages are frequently reviewed and advertised in specialized publications. Modern computers are also equipped with capabilities to generate random numbers, serving as a practical alternative to traditional printed tables. While the "random" numbers generated by most computers are technically pseudorandom, arising from deterministic algorithms, they are generally considered satisfactory for most practical research applications.
2.11 Beyond statistical analysis: Computers in health sciences
The utility of computers extends beyond statistical computations to encompass a broad spectrum of health sciences applications. Numerous resources, including books and periodicals, are dedicated to exploring the role of computers in biology, medicine, and related fields, covering areas from information retrieval to Internet applications and specialized computational methods. This book itself utilizes computer printouts from popular statistical software packages such as MINITAB, SPSS, R, and SAS® to illustrate biostatistical analyses.
2.12 Summary of foundational biostatistical concepts
This chapter introduced fundamental statistical concepts, defining statistics as the discipline concerned with data collection, description, and the process of making inferences. Statistical inference was defined as the procedure of drawing conclusions about a population based on a sample derived from it. The importance of a simple random sample as a basis for valid inferences was highlighted, along with methods for obtaining such samples using random number tables.
Key terms such as "variable" and "sample" were defined. The concept of measurement was discussed, and four distinct measurement scales were introduced: nominal, ordinal, interval, and ratio. The scientific method and the integral role of statistics and statisticians within this process were also explored. Finally, the indispensable contribution of computers to various statistical activities was emphasized.
2.13 Key definitions and measurement scales
- Statistics: The field concerned with collecting, describing, and analyzing data, and making inferences.
- Biostatistics: The application of statistical methods to biological and health-related problems.
- Statistical Inference: The process of drawing conclusions about a population based on data from a sample.
- Variable: A characteristic or attribute that can vary among individuals or units in a study.
- Population: The entire group of individuals or units of interest in a study.
- Sample: A subset of the population from which data are collected.
- Measurement Scales:
- Nominal: Categorical data where categories have no inherent order (e.g., gender, blood type).
- Ordinal: Categorical data where categories have a natural order but the distance between them is not necessarily equal (e.g., class standing, Likert scales).
- Interval: Numerical data where the difference between values is meaningful, but there is no true zero point (e.g., temperature in Celsius or Fahrenheit).
- Ratio: Numerical data where differences are meaningful, and there is a true zero point, allowing for ratios (e.g., weight, height, age).
Remember: Understanding measurement scales is crucial for selecting appropriate statistical analyses.
3. Descriptive statistics and probability distributions (part 1)
This section introduces foundational techniques for organizing and summarizing data to reveal underlying information, focusing on descriptive statistics and the initial concepts of probability distributions.
3.1 Introduction to descriptive statistics
Descriptive statistics are essential tools for making sense of large datasets that are too numerous or complex to understand through simple observation. These techniques aim to condense and organize information into a manageable set of descriptive measures and visual representations, thereby enhancing comprehension of complex data. Raw data, which are unordered measurements or observations, lack informativeness until organized and summarized. The primary objective is to determine the nature of the information contained within these numbers.
Note: The ultimate goal of summarization is to derive single numbers that convey important information about the dataset from which they were calculated. These are known as descriptive measures.
3.2 The ordered array
An ordered array is the first step in organizing data. It is a list of data values, whether from a population or a sample, arranged in ascending order from the smallest to the largest value. For datasets of any significant size, using a computer to generate an ordered array is highly recommended. An ordered array allows for quick identification of the minimum and maximum values and other fundamental facts about the data 38.
Example: An ordered array of ages quickly reveals the youngest and oldest subjects in a study, as well as providing a general sense of age distribution .
While valuable for manual analysis and quick reference, an ordered array is not strictly necessary for computer-based analyses like frequency distributions, as most statistical software can sort data directly 39.
3.3 Grouped data: The frequency distribution
Grouping data involves organizing observations into contiguous, non-overlapping intervals called class intervals. This process, while potentially losing some specificity, is crucial for summarization, making large datasets more comprehensible.
3.4 Determining the number and width of class intervals
-
Number of class intervals (k):
- Too few intervals lead to a loss of information; too many fail to achieve summarization.
- A common rule of thumb suggests between five and 15 intervals.
- Sturges's formula provides a more formal guide: k=1+3.322log10(n), where n is the number of observations.
- The result from Sturges's formula should be used as a guide, and adjusted for convenience and clarity.
-
Width of class intervals (w):
- Class intervals are generally of equal width, though this is not always feasible.
- A preliminary width can be estimated by dividing the range (R) by the number of class intervals (k): w=kR 40.
- The calculated width may be inconvenient, and it is often adjusted to a more practical value (e.g., 5, 10, or multiples of 10) using good judgment.
- When using convenient widths, it is good practice for the lower limit of each interval to end in a zero or a five.
- The lower limit of the first interval should be less than or equal to the smallest measurement, and the upper limit of the last interval should be greater than or equal to the largest measurement.
Tip: Most statistical packages allow interactive adjustment of class intervals and widths, facilitating the exploration of different data visualizations 41.
3.5 Components of a frequency distribution
- Class interval: A range of values within which data points are grouped.
- Frequency: The number of observations that fall within a specific class interval.
- Midpoint: The center of a class interval, calculated as the sum of the lower and upper limits divided by 2. For example, the midpoint of the 30–39 interval is 230+39=34.5.
- Relative frequency: The proportion of observations in a class interval, calculated by dividing the class frequency by the total number of observations. This can also be interpreted as the experimental or empirical probability of occurrence within that interval.
- Cumulative frequency: The sum of frequencies for a given class interval and all preceding class intervals.
- Cumulative relative frequency: The sum of relative frequencies for a given class interval and all preceding class intervals.
Note: Frequencies or relative frequencies may not sum to exactly 1.0000 due to rounding.
3.6 Graphical representations of frequency distributions
-
Histogram: A bar graph where the horizontal axis represents the values of the variable (with true class boundaries to avoid gaps) and the vertical axis represents the frequency or relative frequency. The area of each bar corresponds to the relative frequency of the data within that interval 43.
- True class limits: These are used to construct histograms and prevent gaps between bars. For data rounded to the nearest whole number, the true limits are typically set at the midpoint between the upper limit of one interval and the lower limit of the next (e.g., 39.5 and 49.5 for the 40-49 interval) 44.
-
Frequency polygon: A line graph created by plotting points above the midpoint of each class interval at a height corresponding to its frequency. Connecting these points with straight lines forms the polygon. The polygon is typically extended to the horizontal axis at both ends to enclose the total area.
Important: The total area under a histogram or a frequency polygon is equal to the total number of observations (or 1.00 if using relative frequencies) 45.
-
Stem-and-leaf display: A graphical method that resembles a histogram but preserves the individual data points. Each measurement is divided into a "stem" (initial digits) and a "leaf" (remaining digits). Stems are listed in order, with leaves for each stem listed to their right. This method eliminates the need for a separate ordered array and is particularly useful for smaller datasets 46.
Tip: Stem-and-leaf displays are best for understanding the nature of one's data rather than for public consumption. Histograms are more suitable for externally circulated publications. The MINITAB software can generate stem-and-leaf displays, allowing for adjustments to the interval width (increment) to refine the display 47 48.
3.7 Introduction to probability distributions
While the preceding sections focused on describing observed data, the next logical step is to explore the theoretical probability distributions that describe the behavior of random variables. This section begins by touching upon the concept that relative frequencies from observed data can be interpreted as probabilities. Further exploration of specific probability distributions for discrete and continuous variables will be covered in subsequent sections 42.
This section introduces fundamental descriptive statistics for organizing and summarizing data, alongside the foundational concepts of probability distributions.
3.8 Organizing and visualizing data
Raw data is often difficult to interpret directly. Descriptive statistics provide methods to organize, summarize, and visualize data to reveal patterns and characteristics. Key techniques include creating ordered arrays, frequency distributions, and graphical representations like histograms and frequency polygons.
3.9 Ordered array
An ordered array is a list of data values arranged in ascending or descending order. This arrangement facilitates the identification of the smallest and largest values and provides a preliminary view of the data's spread.
3.10 Frequency distributions
A frequency distribution organizes data by grouping it into classes or intervals and showing the number of observations that fall into each class. This helps to condense a large dataset into a more manageable format.
- Frequency distribution: A table that lists data values or groups them into intervals (classes) and shows the number of observations in each class.
- Relative frequency distribution: This distribution presents the proportion or percentage of observations that fall into each class. It is calculated by dividing the frequency of each class by the total number of observations.
- Formula:
Relative Frequency = Frequency of Class / Total Number of Observations
- Formula:
- Cumulative frequency distribution: This shows the total number of observations that fall below the upper boundary of each class. It is calculated by adding the frequencies of all preceding classes to the frequency of the current class.
- Cumulative relative frequency distribution: This displays the proportion or percentage of observations that fall below the upper boundary of each class. It is calculated by adding the relative frequencies of all preceding classes to the relative frequency of the current class.
Example: In a dataset of test scores, a cumulative frequency distribution would show how many students scored below a certain mark, such as 70, 80, or 90.
3.11 Graphical representations
Visualizing data through graphs enhances understanding of its distribution, shape, and central tendency.
- Histogram: A bar graph where the horizontal axis represents the classes of a frequency distribution, and the vertical axis represents the frequency of each class. The bars are adjacent, indicating that the data is continuous or treated as such. Histograms are useful for showing the shape of the distribution, its symmetry, and its dispersion.
- Frequency polygon: A line graph that connects the midpoints of the upper class boundaries of a histogram. The midpoints represent the average value within each class interval. The polygon starts and ends on the horizontal axis, creating a closed figure that visually represents the distribution's shape. It is particularly useful for comparing the shapes of multiple distributions on the same graph.
Note: Both histograms and frequency polygons are valuable tools for assessing the symmetry and skewness of a dataset. A symmetric distribution is balanced around its center, while a skewed distribution has a longer tail on one side.
3.12 Basic probability concepts and distributions
Probability theory provides a framework for understanding and quantifying uncertainty. Probability distributions describe the likelihood of different outcomes for random variables.
3.13 Introduction to probability
Probability measures the likelihood of an event occurring. It is a value between 0 and 1, inclusive, where 0 indicates an impossible event and 1 indicates a certain event.
3.14 Random variables
A random variable is a variable whose value is a numerical outcome of a random phenomenon.
- Discrete random variable: A random variable that can only take a finite number of values or a countably infinite number of values (e.g., the number of heads in three coin flips).
- Continuous random variable: A random variable that can take any value within a given range (e.g., the height of a person).
3.15 Probability distributions for discrete random variables
These distributions specify the probability of each possible outcome for a discrete random variable.
- Binomial distribution: This distribution describes the probability of obtaining a specific number of successes in a fixed number of independent Bernoulli trials (trials with only two possible outcomes, success or failure).
- The probability mass function (PMF) for a binomial distribution is given by:
P(X=k)=(kn)pk(1−p)n−k
where:
- n is the number of trials.
- k is the number of successful outcomes.
- p is the probability of success on a single trial.
- (kn) is the binomial coefficient, calculated as k!(n−k)!n!.
- The probability mass function (PMF) for a binomial distribution is given by:
P(X=k)=(kn)pk(1−p)n−k
where:
Tip: The binomial distribution is applicable when there are a fixed number of independent trials, each with two outcomes, and the probability of success remains constant.
- Poisson distribution: This distribution models the probability of a given number of events occurring in a fixed interval of time or space, provided these events occur with a known constant mean rate and independently of the time since the last event. It is often used for rare events.
- The probability mass function (PMF) for a Poisson distribution is given by:
P(X=k)=k!λke−λ
- k is the number of occurrences of the event.
- λ (lambda) is the average rate of occurrence of the event in the interval.
- e is the base of the natural logarithm (approximately 2.71828).
- The probability mass function (PMF) for a Poisson distribution is given by:
P(X=k)=k!λke−λ
3.16 Probability distributions for continuous random variables
These distributions describe the probability of a continuous random variable falling within a certain range of values.
- Normal distribution (or Gaussian distribution): This is one of the most important probability distributions. It is a symmetric, bell-shaped curve that is characterized by its mean (μ) and standard deviation (σ). Many natural phenomena approximate a normal distribution.
- The probability density function (PDF) for a normal distribution is:
f(x∣μ,σ2)=2πσ21e−2σ2(x−μ)2
- x is the variable.
- μ is the mean.
- σ2 is the variance (standard deviation squared).
- π is pi.
- e is the base of the natural logarithm.
- The probability density function (PDF) for a normal distribution is:
f(x∣μ,σ2)=2πσ21e−2σ2(x−μ)2
Remember: The total area under the normal curve is equal to 1, representing 100% probability. The area under the curve between two values represents the probability that the random variable falls within that range.
Important: The normal distribution is fundamental in statistics and serves as the basis for many inferential statistical methods. Its properties, such as symmetry and the empirical rule (68-95-99.7 rule), are crucial for data interpretation.
4. Descriptive statistics and probability distributions (part 2)
This section elaborates on descriptive statistical measures, focusing on measures of central tendency and dispersion, and introduces the concepts of skewness and kurtosis.
4.1 Measures of central tendency
Measures of central tendency aim to summarize a dataset by identifying a single value that represents the center or typical value of the data.
-
Mean: The arithmetic mean is calculated by summing all values in a dataset and dividing by the total number of values.
- For a finite population of size N, the population mean (μ) is: μ=N∑i=1Nxi [ ].
- For a sample of size n, the sample mean (xˉ) is: xˉ=n∑i=1nxi [ ] 57.
- Properties of the Mean:
- Uniqueness: There is only one mean for a given dataset.
- Simplicity: It is easy to understand and compute.
- Sensitivity to Extreme Values: The mean is affected by every value in the dataset, making it susceptible to distortion by outliers.
Example: A set of charges EUR 75, EUR 75, EUR 80, EUR 80, and EUR 280 has a mean of EUR 118, which is significantly inflated by the EUR 280 value. [ ].
-
Median: The median is the middle value in a dataset when it is ordered by magnitude. It divides the data into two equal halves.
- If the number of observations (n) is odd, the median is the 2n+1th ordered observation.
- If the number of observations (n) is even, the median is the average of the 2nth and 2n+1th ordered observations.
- Properties of the Median:
- Uniqueness: There is only one median for a given dataset.
- Simplicity: It is easy to calculate.
- Robustness to Extreme Values: It is less affected by outliers compared to the mean.
Example: For the ordered ages 38, 43, 50, 57, 57, 59, 61, 64, 65, 66, the median is the average of the 5th and 6th values: 257+59=58. [ ] 58.
-
Mode: The mode is the value that occurs most frequently in a dataset.
- A dataset can have no mode (if all values are unique), one mode (unimodal), or multiple modes (bimodal, multimodal).
- It can be used for both quantitative and qualitative data. [ ] 59.
- Attractive Property: A distribution is considered ideal when the mean, median, and mode are equal, often represented by a symmetric bell-shaped curve like the normal distribution.
4.2 Measures of dispersion
Measures of dispersion quantify the variability or spread of data points within a dataset.
-
Range: The difference between the largest and smallest values in a dataset.
- Formula: R=xL−xS, where xL is the largest value and xS is the smallest value. [ ] 61.
- Limitations: It is a crude measure of dispersion as it only considers two extreme values. It is often more informative to express the range as a pair [xS,xL].
Example: For ages 30 to 82, the range is 82−30=52. [ ].
-
Variance: The average of the squared differences between each data point and the mean. It measures the spread of data around the mean.
- The squaring of differences is done to ensure a positive value and to give more weight to larger deviations.
- Sample Variance (s2):
s2=n−1∑i=1n(xi−xˉ)2
[ ] 62.
- The denominator is n−1 (degrees of freedom) to provide an unbiased estimate of the population variance.
- Population Variance (σ2):
σ2=N∑i=1N(xi−μ)2
Example: For ages 43, 66, ..., 50 with a mean of 56, the sample variance is: s2=10−1(43−56)2+(66−56)2+⋯+(50−56)2=9810=90
-
Standard Deviation: The square root of the variance. It expresses dispersion in the original units of the data, making it more interpretable.
- Sample Standard Deviation (s): s=s2=n−1∑i=1n(xi−xˉ)2
- Population Standard Deviation (σ): σ=σ2 [ ] 63.
-
Coefficient of Variation (C.V.): A measure of relative variability, expressed as a percentage of the mean. It is useful for comparing the dispersion of datasets with different units or vastly different means.
- Formula:
C.V.=xˉs×100%
Example: Comparing weights of 25-year-olds (mean 145 lbs, std dev 10 lbs) and 11-year-olds (mean 80 lbs, std dev 10 lbs):
- 25-year-olds: C.V. = 14510×100%≈6.9%
- 11-year-olds: C.V. = 8010×100%≈12.5% This shows that the weights of the 11-year-olds are relatively more variable. [ ] 64.
- Formula:
C.V.=xˉs×100%
-
Percentiles and Quartiles:
- Percentile: The pth percentile (Pp) is the value below which p percent of the observations fall.
- Quartiles: Special percentiles that divide the data into four equal parts.
- Q1 (First Quartile): The 25th percentile.
- Q2 (Second Quartile / Median): The 50th percentile.
- Q3 (Third Quartile): The 75th percentile.
- Position of Quartiles:
- Q1: Position = 4n+1th ordered observation
- Q2: Position = 42(n+1)=2n+1th ordered observation
- Q3: Position = 43(n+1)th ordered observation
Note: These formulas indicate the position, not the value, of the quartiles, and different software may use slightly different calculation methods.
-
Interquartile Range (IQR): The difference between the third and first quartiles. It measures the spread of the middle 50% of the data.
- Formula: IQR=Q3−Q1 [ ] 66.
- It is less affected by outliers than the overall range.
-
Box-and-Whisker Plot: A graphical representation that displays the five-number summary of a dataset: minimum, first quartile (Q1), median (Q2), third quartile (Q3), and maximum.
- A box spans from Q1 to Q3, with a line at the median.
- "Whiskers" extend from the box to the minimum and maximum values.
- It provides insights into spread, location of concentration, and symmetry. [ ] 68.
- Outliers: Observations that fall far outside the main body of data. They are defined as values:
- Less than Q1−1.5×IQR
- Greater than Q3+1.5×IQR
4.3 Skewness and kurtosis
These are measures that describe the shape of a distribution beyond its central tendency and dispersion.
-
Skewness: Measures the asymmetry of a distribution.
- Symmetric Distribution: The left and right halves of the graph are mirror images. Mean = Median = Mode.
- Positively Skewed (Skewed to the Right): The graph has a longer tail to the right. Mean > Median > Mode.
- Negatively Skewed (Skewed to the Left): The graph has a longer tail to the left. Mean < Median < Mode.
- Formula for sample skewness: Skewness=(∑i=1n(xi−xˉ)2)3/2n∑i=1n(xi−xˉ)3=(n−1)3/2s3n∑i=1n(xi−xˉ)3
- A skewness value >0 indicates positive skew; <0 indicates negative skew; =0 indicates no skew.
Example: Figure 2.4.1 shows histograms illustrating no skew (Mean=8, Median=8, Mode=8), right skew (Mean=6.6667, Median=6, Mode=5), and left skew (Mean=8.3333, Median=9, Mode=10). [ ] 60.
-
Kurtosis: Measures the "peakedness" or "flatness" of a distribution relative to a normal distribution.
- Mesokurtic: Similar peakedness to a normal distribution.
- Leptokurtic: More peaked than a normal distribution, with heavier tails. Kurtosis measure > 0 (when adjusted by -3).
- Platykurtic: Flatter than a normal distribution, with lighter tails. Kurtosis measure < 0 (when adjusted by -3).
- Formula for kurtosis (adjusted by -3):
Kurtosis=(∑i=1n(xi−xˉ)2)2n∑i=1n(xi−xˉ)4−3=(n−1)2s4n∑i=1n(xi−xˉ)4−3
Example: Figure 2.5.4 shows distributions with Kurtosis values of.000 (mesokurtic),.608 (leptokurtic), and -1.158 (platykurtic) when adjusted by -3. [ ] 67.
4.4 Exploratory Data Analysis (EDA) techniques
EDA techniques, such as box-and-whisker plots and stem-and-leaf displays, are used to examine data visually, reveal trends, identify unique features, and facilitate summarization. These methods, popularized by Tukey, help in understanding data before formal statistical modeling. [ ] 70.
This section of the study guide delves into the fundamental tools of descriptive statistics and introduces the foundational concepts of probability and various probability distributions.
4.5 Organization of data
Descriptive statistics aims to organize and summarize data to reveal patterns and characteristics. Key methods for organizing raw data include:
- Ordered array: A list of data values arranged in ascending or descending order. This facilitates identifying the minimum, maximum, and general spread of the data. For example, the follow-up care durations in months for subjects who underwent surgery in Exercise 2.5.6, when ordered, reveal the range and central tendency more clearly than the raw list.
- Frequency distribution: A table that groups data into classes (intervals) and shows the number of observations (frequency) falling into each class. This provides a structured overview of data distribution.
- Relative frequency distribution: Similar to a frequency distribution, but it shows the proportion (or percentage) of observations in each class relative to the total number of observations. This allows for comparison between datasets of different sizes.
- Histogram: A graphical representation of a frequency distribution, where bars represent the frequency of data within each class interval. The bars are adjacent, emphasizing the continuous nature of the data.
- Frequency polygon: A line graph that connects the midpoints of the upper sides of the bars in a histogram. It offers a smoother representation of the data distribution compared to a histogram and is useful for comparing multiple distributions.
Example: For the ages of sick parents in Exercise 2.5.14, constructing a frequency distribution would involve defining age intervals (e.g., 30-39, 40-49) and counting how many parents fall into each interval. This organized data can then be visualized using a histogram or frequency polygon 12.
4.6 Measures of central tendency and variation
These measures quantify the typical value and the spread of data:
-
Central Tendency:
- Mean: The arithmetic average of a dataset.
- Population mean: μ=N∑i=1Nxi.
- Sample mean: xˉ=n∑i=1nxi.
- Median: The middle value in an ordered dataset. If there's an even number of observations, it's the average of the two middle values.
- Mode: The most frequently occurring value in a dataset.
- Mean: The arithmetic average of a dataset.
-
Variation (Dispersion):
- Range: The difference between the largest and smallest data points.
- R=xL−xS.
- Variance: The average of the squared differences from the mean.
- Population variance: σ2=N∑i=1N(xi−μ)2.
- Sample variance: s2=n−1∑i=1n(xi−xˉ)2 The use of n−1 in the denominator for sample variance provides an unbiased estimator of the population variance.
- Standard deviation: The square root of the variance, representing the typical deviation of data points from the mean.
- s=s2=n−1∑i=1n(xi−xˉ)2.
- Coefficient of variation: The ratio of the standard deviation to the mean, expressed as a percentage. It's useful for comparing the relative variability of datasets with different means.
- C.V.=xˉs×100%.
- Range: The difference between the largest and smallest data points.
Note: The symbol key on page 74 provides definitions for various statistical symbols used, such as k for the number of class intervals, m for the population mean, n for sample size, and w for class width 74.
4.7 Skewness and kurtosis
These are higher-order descriptive statistics that describe the shape of a distribution:
- Skewness: Measures the asymmetry of a probability distribution. A positive skew indicates a tail extending to the right, while a negative skew indicates a tail extending to the left. A skewness of zero suggests symmetry.
- Kurtosis: Measures the "tailedness" of a probability distribution, indicating the propensity of outliers. High kurtosis (leptokurtic) means heavier tails and a sharper peak, while low kurtosis (platykurtic) means lighter tails and a flatter peak. A normal distribution has a kurtosis of 3 (or 0 when excess kurtosis is considered).
4.8 Introduction to probability and probability distributions
Probability quantifies the likelihood of an event occurring, ranging from 0 (impossible) to 1 (certain). Probability distributions describe the probabilities of different outcomes for a random variable.
-
Discrete probability distributions: Apply to random variables that can only take on a finite or countably infinite number of values.
- Binomial distribution: Models the number of successes in a fixed number of independent Bernoulli trials (trials with two outcomes: success or failure), where the probability of success is constant for each trial.
- Poisson distribution: Models the number of events occurring in a fixed interval of time or space, given a known average rate of occurrence. It is often used for rare events.
-
Continuous probability distributions: Apply to random variables that can take on any value within a given range.
- Normal distribution: A bell-shaped, symmetrical distribution that is fundamental in statistics. Many natural phenomena approximate a normal distribution. Its shape is determined by its mean (μ) and standard deviation (σ). The probability density function for the normal distribution is given by: f(x)=σ2π1e−21(σx−μ)2 [No specific page reference for formula but implied context of distributions
Remember: The normal distribution is crucial because of the Central Limit Theorem, which states that the distribution of sample means will approach a normal distribution as the sample size gets larger, regardless of the population's distribution.
The study guide also touches upon exploratory data analysis techniques like stem-and-leaf displays and box-and-whisker plots, which are visual methods for understanding data structure and dispersion. These graphical tools, alongside frequency distributions and histograms, are essential for an initial understanding of a dataset before applying more advanced statistical analyses 73.
5. Descriptive statistics and probability distributions (part 3)
This section explores foundational concepts in descriptive statistics, including data visualization techniques like histograms and frequency polygons, and introduces fundamental principles of probability along with key probability distributions.
5.1 Data visualization and frequency distributions
Descriptive statistics employ various methods to summarize and present data, making it easier to understand patterns and characteristics. Ordered arrays, frequency distributions, histograms, and frequency polygons are key tools for this purpose.
5.2 Ordered arrays and frequency distributions
An ordered array is a list of data values arranged in ascending or descending order. While useful for identifying the range and potential outliers, it becomes cumbersome with large datasets. A frequency distribution organizes data into classes or bins, showing the frequency (count) of data points falling within each class. This provides a more condensed view of the data's distribution.
- Relative frequency distribution: This distribution shows the proportion of data points in each class, calculated by dividing the class frequency by the total number of observations.
- Cumulative frequency distribution: This distribution shows the total frequency of data points that fall below a certain class boundary. It is calculated by summing the frequencies of all classes up to and including the current class.
- Cumulative relative frequency distribution: This combines the concepts of relative frequency and cumulative frequency, showing the proportion of data points that fall below a certain class boundary.
Note: The choice of class intervals is crucial for constructing an effective frequency distribution. Intervals should be mutually exclusive, exhaustive, and of appropriate width to reveal the data's shape without being too coarse or too fine. Sturges' Rule is a common guideline for determining the optimal number of classes 22.
5.3 Graphical representations
Visualizing frequency distributions enhances understanding.
- Histograms: A histogram is a bar graph where the horizontal axis represents the class intervals and the vertical axis represents the frequency (or relative frequency) of each class. The bars are contiguous, indicating a continuous variable.
- Frequency polygons: A frequency polygon is created by plotting a point at the midpoint of each class interval at the height of the class frequency, and then connecting these points with straight lines. This graphical representation is useful for comparing multiple distributions.
Example: Exercise 18 requires constructing a cumulative frequency distribution, a relative frequency distribution, and a cumulative relative frequency distribution for the age distribution of live births in Albany County, New York, for the year 2000 18.
5.4 Basic probability concepts
Probability is the measure of the likelihood of an event occurring, expressed as a number between 0 and 1. A probability of 0 indicates an impossible event, while a probability of 1 indicates a certain event.
5.5 Views of probability
There are two primary views of probability:
- Objective probability: This view assumes probability is an inherent property of the process or phenomenon being studied.
- Classical (a priori) probability: Calculated based on logical reasoning and the assumption of equally likely outcomes. If an event can occur in m mutually exclusive and equally likely ways out of a total of N possible ways, its probability is P(E)=Nm 3.2.1. This is often used in games of chance.
- Relative frequency (a posteriori) probability: Determined by observing the outcomes of a process repeated many times. If an event with characteristic E occurs m times in n repetitions, its probability is estimated as P(E)≈nm 3.2.2. This is an empirical approach.
- Subjective probability: This view measures an individual's degree of belief in the truth of a proposition, independent of repeatability. It can be used for unique events.
Important: Bayesian methods are an example of subjective probability, incorporating prior probabilities (based on existing knowledge) and updating them with new information to derive posterior probabilities.
5.6 Elementary properties of probability
Kolmogorov's axiomatic approach formalizes probability with three core properties:
- Non-negativity: The probability of any event Ei must be non-negative: P(Ei)≥0 3.3.1.
- Exhaustiveness: The sum of probabilities of all mutually exclusive outcomes must equal 1: P(E1)+P(E2)+⋯+P(En)=1 3.3.2. This implies that all possible outcomes are accounted for.
- Additivity for mutually exclusive events: For any two mutually exclusive events Ei and Ej, the probability of either occurring is the sum of their individual probabilities: P(Ei∪Ej)=P(Ei)+P(Ej) 3.3.3.
5.7 Calculating the probability of an event
- Unconditional probability: The probability of an event without any restrictions, often calculated using frequencies from a total population or sample 3.4.1.
- Conditional probability: The probability of an event occurring given that another event has already occurred. It is denoted as P(A∣B) and calculated as P(A∣B)=P(B)P(A∩B), provided P(B)=0 3.4.2.
Example: In Table 3.4.1, if we select a subject from the 318 total subjects and find they are "Early" (E), the conditional probability that they have no family history of mood disorders (A) is P(A∣E)=14128≈0.1986 3.4.2.
- Joint probability: The probability that two events occur simultaneously, denoted as P(A∩B). It can be calculated directly from frequencies or using the multiplication rule.
- Multiplication rule: This rule states that the joint probability of two events A and B can be calculated as P(A∩B)=P(A)P(B∣A) or P(A∩B)=P(B)P(A∣B) 3.4.1.
Example: The joint probability of a subject being "Early" (E) and having no family history of mood disorders (A) is P(E∩A)=P(E)P(A∣E)=(318141)(14128)=31828≈0.0881 3.4.4.
- Addition rule: For two events A and B, the probability that either A or B (or both) occurs is P(A∪B)=P(A)+P(B)−P(A∩B). If A and B are mutually exclusive, P(A∩B)=0, and the rule simplifies to P(A∪B)=P(A)+P(B) 3.4.4.
5.8 Introduction to probability distributions
Probability distributions describe the likelihood of different outcomes for a random variable. They are categorized into discrete and continuous types.
5.9 Discrete probability distributions
Discrete probability distributions apply to random variables that can only take on a finite number of values or a countably infinite number of values.
-
Binomial distribution: This distribution models the probability of obtaining a specific number of successes in a fixed number of independent Bernoulli trials (trials with only two possible outcomes, success or failure). The parameters are n (number of trials) and p (probability of success on a single trial). The probability mass function is given by: P(X=k)=(kn)pk(1−p)n−k where X is the random variable representing the number of successes, and k is the specific number of successes.
-
Poisson distribution: This distribution models the probability of a given number of events occurring in a fixed interval of time or space, assuming these events occur with a known constant mean rate and independently of the time since the last event. The parameter is λ (lambda), the average number of events in the interval. The probability mass function is: P(X=k)=k!λke−λ where X is the random variable representing the number of events, and k is the specific number of events. The Poisson distribution is often used to approximate the binomial distribution when n is large and p is small.
5.10 Continuous probability distributions
Continuous probability distributions apply to random variables that can take any value within a given range.
- Normal distribution (Gaussian distribution): This is one of the most important continuous probability distributions. It is bell-shaped and symmetrical, characterized by its mean (μ) and standard deviation (σ). The probability density function is: f(x)=σ2π1e−21(σx−μ)2 The normal distribution is critical in statistics because of the Central Limit Theorem, which states that the distribution of sample means approaches a normal distribution as the sample size increases, regardless of the population distribution.
Reminder: For any probability distribution, the area under the curve represents probability, and the total area under the curve equals 1. The normal distribution is frequently used to model various natural phenomena and is a cornerstone for hypothesis testing and confidence interval construction.
This section focuses on fundamental probability rules, the distinction between independent and mutually exclusive events, and the calculation of marginal probabilities.
5.11 Addition rule and mutually exclusive events
The addition rule is used to calculate the probability of the union of two events, denoted as P(A∪B), which represents the probability that either event A or event B (or both) occurs. The general form of the addition rule is:
P(A∪B)=P(A)+P(B)−P(A∩B)
where:
- P(A) is the probability of event A.
- P(B) is the probability of event B.
- P(A∩B) is the probability of both A and B occurring simultaneously (the intersection of A and B).
If events A and B are mutually exclusive, meaning they cannot occur at the same time, then their intersection is empty, and P(A∩B)=0. In this case, the addition rule simplifies to:
P(A∪B)=P(A)+P(B)
This simplified form indicates that for mutually exclusive events, the probability of either event occurring is simply the sum of their individual probabilities.
Example: If we select a person at random, the probability of them being an Early age of onset subject (E) or having no family history of mood disorders (A) or both is calculated using the addition rule. If P(E)=0.4434, P(A)=0.1981, and P(E∩A)=0.0881, then P(E∪A)=0.4434+0.1981−0.0881=0.5534. The subtraction of P(E∩A) accounts for individuals counted in both groups 91.
5.12 Independent events
Two events, A and B, are considered independent if the occurrence of one event does not affect the probability of the other event occurring. Mathematically, this is expressed as P(A∣B)=P(A) or P(B∣A)=P(B).
The multiplication rule for independent events simplifies the calculation of the probability of their joint occurrence:
P(A∩B)=P(A)P(B)
This means that for independent events, the probability of both occurring is the product of their individual probabilities. It is crucial to distinguish between independent events and mutually exclusive events; they are not synonymous.
Example: In a high school class, if the probability of a student wearing eyeglasses is P(E)=0.4 and the probability of a student being a boy is P(B)=0.4, and these events are independent, then the probability of a student being a boy and wearing eyeglasses is P(E∩B)=P(B)P(E)=0.4×0.4=0.16 92.
5.13 Complementary events
Complementary events are two events that are mutually exclusive and their union covers all possible outcomes. If A is an event, its complement, denoted as Ac or Aˉ, represents the event that A does not occur. The sum of the probabilities of an event and its complement is always 1:
P(Ac)=1−P(A)
Example: If 750 out of 1200 hospital admissions are private (P(A)=750/1200=0.625), then the probability of a non-private admission (the complement) is P(Ac)=1−0.625=0.375 93.
5.14 Marginal probability
Marginal probability refers to the probability of an event associated with one variable in a joint probability distribution, irrespective of the outcomes of other variables. When dealing with contingency tables, marginal probabilities are derived from the marginal totals.
More formally, for two variables, A and B, with categories A1,A2,...,Am and B1,B2,...,Bn respectively, the marginal probability of category Ai is the sum of the joint probabilities of Ai with all categories of B:
P(Ai)=∑j=1nP(Ai∩Bj)
This is equivalent to dividing the marginal total for category Ai by the total number of observations.
Example: Using data from Table 3.4.1, the marginal probability of an Early age of onset subject (P(E)) can be calculated by summing the joint probabilities of E with each category of family history of mood disorders: P(E)=P(E∩A)+P(E∩B)+P(E∩C)+P(E∩D). Alternatively, it can be calculated directly from the marginal total for E 94.
5.15 Calculations involving joint, conditional, and marginal probabilities
The relationships between joint, conditional, and marginal probabilities allow for various probability calculations.
- Joint probability: P(A∩B)=P(A)P(B∣A)=P(B)P(A∣B). For independent events, P(A∩B)=P(A)P(B).
- Conditional probability: P(A∣B)=P(A∩B)/P(B) and P(B∣A)=P(A∩B)/P(A).
- Marginal probability: P(A)=∑P(A∩Bi) and P(B)=∑P(Ai∩B).
Note: Exercises provided illustrate the application of these rules in scenarios involving cross-classified data, such as determining probabilities based on sex and victimization, or gender and drug-splitting practices 94-96. These examples reinforce the understanding of how to derive different types of probabilities from empirical data.
6. Descriptive statistics and probability distributions (part 4)
This section delves into the concepts of probability and its application in evaluating screening tests, introducing key metrics like sensitivity, specificity, and predictive values, and demonstrating their calculation using Bayes' theorem.
6.1 False positives, false negatives, and screening test evaluation
Screening tests are essential tools in identifying potential health conditions, but they are not always perfect. They can produce two types of errors: false positives and false negatives. Understanding these errors and other related probabilities is crucial for accurately interpreting test results and assessing the overall usefulness of a screening tool.
- False Positive: A test result indicates a positive status when the true status is negative.
- False Negative: A test result indicates a negative status when the true status is positive.
To evaluate a screening test or symptom, four key questions need to be answered:
- The probability of a positive test result given the presence of the disease.
- The probability of a negative test result given the absence of the disease.
- The probability of having the disease given a positive screening test result.
- The probability of not having the disease given a negative screening test result.
These questions can be addressed using data from a sample of individuals classified by their disease status and test results, often presented in a two-way table.
6.2 Sensitivity and specificity of screening tests
Two fundamental measures used to characterize the performance of a screening test are sensitivity and specificity.
-
Sensitivity: This is the probability of a positive test result given that the individual has the disease. It measures the test's ability to correctly identify those who have the condition. It is calculated from a two-way table as the number of true positives divided by the total number of individuals with the disease. The formula for sensitivity is: Sensitivity=P(T∣D)=a+ca where T denotes a positive test result and D denotes the presence of the disease.
-
Specificity: This is the probability of a negative test result given that the individual does not have the disease. It measures the test's ability to correctly identify those who do not have the condition. It is calculated from a two-way table as the number of true negatives divided by the total number of individuals without the disease. The formula for specificity is: Specificity=P(¬T∣¬D)=b+dd where ¬T denotes a negative test result and ¬D denotes the absence of the disease.
Note: A higher sensitivity indicates fewer false negatives, and a higher specificity indicates fewer false positives.
6.3 Predictive values and Bayes' theorem
Beyond sensitivity and specificity, the predictive value of a test is crucial for understanding the probability of having a disease given a particular test result. These values are influenced by the test's inherent accuracy (sensitivity and specificity) and the prevalence of the disease in the population being tested.
-
Predictive Value Positive (PVP): This is the probability that a subject actually has the disease given that they received a positive screening test result. It answers the question: "If the test is positive, how likely is it that I have the disease?" The PVP can be calculated using Bayes' theorem: P(D∣T)=P(T∣D)P(D)+P(T∣¬D)P(¬D)P(T∣D)P(D) In this formula:
- P(T∣D) is the sensitivity.
- P(D) is the prevalence of the disease in the population.
- P(T∣¬D) is the probability of a positive test given no disease (related to false positives).
- P(¬D) is the probability of not having the disease (1 - prevalence). The numerator, P(T∣D)P(D), represents the joint probability of having the disease and testing positive (P(D∩T)). The denominator, P(T), represents the overall probability of a positive test result, which can be calculated using the law of total probability: P(T)=P(T∣D)P(D)+P(T∣¬D)P(¬D).
-
Predictive Value Negative (PVN): This is the probability that a subject does not have the disease, given that they received a negative screening test result. It answers the question: "If the test is negative, how likely is it that I do not have the disease?" The PVN can also be calculated using Bayes' theorem: P(¬D∣¬T)=P(¬T∣¬D)P(¬D)+P(¬T∣D)P(D)P(¬T∣¬D)P(¬D)
- P(¬T∣¬D) is the specificity.
- P(¬D) is the probability of not having the disease.
- P(¬T∣D) is the probability of a negative test given the disease (related to false negatives).
- P(D) is the prevalence of the disease. The denominator, P(¬T), represents the overall probability of a negative test result: P(¬T)=P(¬T∣¬D)P(¬D)+P(¬T∣D)P(D) 102 99.
Example: A screening test for Alzheimer's disease was evaluated. The sensitivity was estimated at 0.97 and specificity at 0.99. Given a prevalence of 11.3 percent in the population aged 65 and over, the predictive value positive was calculated to be approximately 0.93, indicating a high likelihood of having Alzheimer's if the test is positive. Similarly, the predictive value negative was found to be about 0.996.
Tip: The predictive value of a test is highly dependent on the prevalence of the disease in the population. A test with high sensitivity and specificity might have a low predictive value in a population with a very low disease prevalence, and vice versa 100.
6.4 Data presentation for screening tests
Two-way tables are instrumental in organizing data for screening tests, allowing for the direct calculation of various probabilities. Such a table typically cross-classifies subjects based on their disease status (present/absent) and their test results (positive/negative).
| Test Result | Disease Present (D) | Disease Absent (¬D) | Total |
|---|---|---|---|
| Positive (T) | a | b | a+b |
| Negative (¬T) | c | d | c+d |
| Total | a+c | b+d | n |
From this table:
- a: True positives (disease present, test positive)
- b: False positives (disease absent, test positive)
- c: False negatives (disease present, test negative)
- d: True negatives (disease absent, test negative)
- n: Total number of subjects 97.
This structure facilitates the direct estimation of sensitivity (a/(a+c)), specificity (d/(b+d)), predictive value positive (a/(a+b)), and predictive value negative (d/(c+d)) based on sample data 98.
This section introduces the concept of a probability distribution for discrete random variables, detailing its construction, properties, graphical representation, cumulative form, and calculation of its mean and variance.
6.5 Introduction to probability distributions
A probability distribution is a fundamental tool in statistics that summarizes the relationship between the possible values of a random variable and their associated probabilities. This allows for a concise description of data and aids in making inferences about a population from a sample.
6.6 Probability distributions of discrete variables
A probability distribution for a discrete random variable is a mechanism—be it a table, graph, or formula—that specifies all possible values a discrete random variable can take, along with the probability of each value occurring. If X is a discrete random variable and x represents a specific value it can assume, then P(X=x) or p(x) denotes the probability that X takes on the value x.
6.7 Constructing and representing probability distributions
The process of constructing a probability distribution involves identifying the possible values of the discrete random variable and calculating the probability for each value. This is typically achieved by dividing the frequency of each value by the total number of observations. The resulting probabilities can be presented in a table or visualized as a graph.
Example: Consider a study on food security where X represents the number of food assistance programs used by families. If a value of X occurs with a frequency of 62 out of a total of 297 families, its probability is calculated as p(x=1)=P(X=1)=62/297≈0.2088 111.
The probabilities can be displayed in a table, listing each possible value of X and its corresponding probability P(X=x). Graphically, a probability distribution can be represented by a bar chart where the height of each bar corresponds to the probability of the respective value 112.
6.8 Properties of discrete probability distributions
For any discrete probability distribution, two essential properties must hold:
- The probability of any specific value must be between 0 and 1, inclusive: 0≤P(X=x)≤1.
- The sum of the probabilities for all possible values of the random variable must equal 1: ∑P(X=x)=1.
Note: In many cases, the probabilities in a discrete distribution represent the relative frequencies of the observed data.
6.9 Calculating probabilities from distributions
Once a probability distribution is established, specific probability questions can be answered.
- Probability of a single value: To find the probability of a specific outcome, one simply looks up the value in the probability distribution table. For instance, the probability that a family used exactly three programs is p=P(X=3)=0.13133.
- Probability of mutually exclusive events: For mutually exclusive events (outcomes that cannot occur at the same time), the probability of either event occurring is the sum of their individual probabilities. For example, the probability of using one or two programs is P(X=1 or X=2)=P(X=1)+P(X=2)=0.2088+0.1582=0.3670 113.
6.10 Cumulative probability distributions
A cumulative probability distribution provides the probability that a random variable takes on a value less than or equal to a specified value. It is denoted by F(x)=P(X≤x). This is calculated by successively adding the probabilities from the probability distribution.
6.11 Representation and interpretation of cumulative distributions
The cumulative distribution can be presented in a table, where each entry represents the sum of probabilities up to that point. Graphically, a cumulative distribution is called an ogive. The ogive typically consists of horizontal line segments, with vertical lines connecting them for visual continuity. The height of the graph at a given point indicates the cumulative probability up to that value 114.
Example: For the food assistance program data, the cumulative probability of using two or fewer programs is found directly in the cumulative table as P(X≤2)=0.3670.
6.12 Answering probability questions with cumulative distributions
Cumulative distributions simplify answering questions about ranges of values:
- "Fewer than" probabilities: The probability of a variable being "fewer than k" is equivalent to the cumulative probability of k−1. For example, P(X<4)=P(X≤3)=0.4983.
- Complementary probabilities: To find the probability of a variable being "five or more," one can use the complement rule: P(X≥5)=1−P(X<5)=1−P(X≤4). Using the example data, this would be 1−0.6296=0.3704.
- "Between" probabilities: The probability of a variable falling within a range (inclusive) can be found by subtracting the cumulative probability of the lower bound minus one from the cumulative probability of the upper bound. For example, the probability of using between three and five programs inclusive is P(3≤X≤5)=P(X≤5)−P(X≤2)=0.8249−0.3670=0.4579 115.
6.13 Mean and variance of discrete probability distributions
The mean (μ) and variance (σ2) of a discrete probability distribution quantify its central tendency and spread, respectively. These are calculated using specific formulas.
The formulas are:
-
Mean (μ): μ=∑xp(x) This is calculated by summing the product of each possible value x and its corresponding probability p(x).
-
Variance (σ2): σ2=∑(x−μ)2p(x)=∑x2p(x)−μ2 The variance can be computed by summing the squared differences between each value x and the mean μ, multiplied by the probability p(x), or alternatively, by subtracting the square of the mean from the sum of the squared values multiplied by their probabilities.
The standard deviation (σ) is the positive square root of the variance.
Example Calculation: For the food assistance program data:
- Mean (μ): (0.2088)+(0.1582)+(0.1313)+(0.1313)+(0.1953)+(0.1246)+(0.0135)+(0.0370)≈3.5589 8.
- Variance (σ2): Using the formula, the variance is approximately 3.8559.
- Standard Deviation (σ): 3.8559≈1.9637 programs.
Theoretical probability distributions, such as the binomial, Poisson, and normal distributions, will be studied in detail later, providing frameworks for many variables of interest 116.
7. Descriptive statistics and probability distributions (part 5)
This section details the binomial and Poisson probability distributions, which model discrete random variables, and introduces the foundational concepts of continuous probability distributions.
7.1 The binomial distribution
The binomial distribution is a fundamental probability distribution used for processes that meet specific criteria, known as Bernoulli trials.
7.1.1 Bernoulli trials and processes
A Bernoulli trial is an experiment or random process with only two mutually exclusive outcomes. Conventionally, one outcome is designated as a "success" and the other as a "failure."
A sequence of Bernoulli trials constitutes a Bernoulli process if it satisfies the following conditions:
- Each trial has exactly two mutually exclusive outcomes: success or failure.
- The probability of success, denoted by p, is constant for all trials. The probability of failure is q=1−p.
- The trials are independent, meaning the outcome of one trial does not influence the outcome of any other trial.
The probability of obtaining exactly x successes in n independent Bernoulli trials is given by the binomial probability formula: f(x)=(xn)pxqn−x where:
- f(x) is the probability of exactly x successes.
- n is the number of trials.
- x is the number of successes.
- p is the probability of success on a single trial.
- q is the probability of failure on a single trial (q=1−p).
- (xn)=x!(n−x)!n! is the binomial coefficient, representing the number of ways to choose x successes from n trials without regard to order.
The binomial distribution is characterized by two parameters, n and p. Its mean is E(X)=np and its variance is Var(X)=npq.
Note: The binomial distribution is strictly applicable to sampling from an infinite population or sampling with replacement from a finite population. When sampling without replacement from a finite population, it is generally considered appropriate if the sample size (n) is small relative to the population size (N), typically when N≥10n.
Statistical software, such as Excel and MINITAB, can be used to calculate binomial probabilities, including individual probabilities and cumulative probabilities (e.g., P(X≤x)).
7.2 The Poisson distribution
The Poisson distribution is another important discrete probability distribution, often used for modeling the number of occurrences of an event within a fixed interval of time or space.
7.2.1 The Poisson process and distribution
The Poisson distribution arises from a Poisson process, characterized by the following properties:
- Events occur independently of each other.
- The probability of an event occurring in a given interval is proportional to the length of the interval.
- The probability of more than one event occurring in an infinitesimally small interval is negligible.
- Theoretically, an infinite number of occurrences are possible within the interval.
The probability mass function for the Poisson distribution is: f(x)=x!e−λλx,x=0,1,2,… where:
- f(x) is the probability of exactly x occurrences.
- λ (lambda) is the parameter of the distribution, representing the average number of occurrences in the interval.
- e is the base of the natural logarithm (approximately 2.7183).
- x! is the factorial of x.
A key characteristic of the Poisson distribution is that its mean and variance are equal, both being equal to λ.
Important: The Poisson distribution is particularly useful for modeling counts of rare events, and it can serve as an approximation to the binomial distribution when n is large and p is small, with λ≈np.
Poisson probabilities can be calculated directly using the formula or by consulting Poisson probability tables (like Appendix Table C) which provide cumulative probabilities.
7.3 Continuous probability distributions
Continuous probability distributions describe random variables that can take on any value within a given range. Unlike discrete variables, the probability of a continuous variable equaling a specific exact value is zero.
7.3.1 Graphical representation of continuous distributions
For continuous random variables, probability distributions are represented by smooth curves. The total area under such a curve is equal to one. The probability that the random variable falls within a specific interval is represented by the area under the curve between the interval's boundaries.
This concept builds upon the graphical representations of discrete data, such as histograms and frequency polygons. As the number of observations increases and class intervals become infinitesimally small, histograms and their corresponding frequency polygons approximate smooth curves, which are the probability density functions (PDFs) for continuous distributions.
8. Sampling distributions and hypothesis testing (part 1)
This section introduces the fundamental concepts of sampling distributions and the initial stages of hypothesis testing, focusing on distributions of sample means and proportions and their application in testing claims about population parameters.
8.1 Continuous probability distributions and the normal distribution
Continuous random variables are characterized by their probability density function (PDF), denoted as f(x), which is a nonnegative function where the total area under the curve and above the x-axis equals 1. The probability that a continuous random variable X falls between two values a and b is represented by the area under the PDF curve between a and b, i.e., P(a<X<b).
The normal distribution, also known as the Gaussian distribution, is the most crucial distribution in statistics. Its PDF is given by: f(x)=σ2π1e−21(σx−μ)2 for −∞<x<∞. The distribution is defined by two parameters: μ (mean) and σ (standard deviation).
Key characteristics of the normal distribution include:
- Symmetry: It is symmetrical about its mean, μ.
- Central Tendency: The mean, median, and mode are all equal.
- Total Area: The total area under the curve is 1.
- Empirical Rule: Approximately 68% of the area lies within 1 standard deviation of the mean (μ±σ), 95% within 2 standard deviations (μ±2σ), and 99.7% within 3 standard deviations (μ±3σ).
- Parameters: μ is a location parameter, and σ is a shape parameter.
Important: Different values of μ shift the distribution along the x-axis, while different values of σ affect its peakedness or flatness.
8.2 The standard normal distribution
The standard normal distribution is a special case of the normal distribution with a mean (μ) of 0 and a standard deviation (σ) of 1. It is obtained by transforming any normally distributed random variable X using the z-score formula: z=σx−μ The PDF for the standard normal distribution is: f(z)=2π1e−2z2 for −∞<z<∞. The z-score represents the number of standard deviations a particular value x is away from the mean μ. Standard normal distribution tables (like Table D in the appendix) are used to find probabilities (areas under the curve) for specific z-scores.
Example: To find the probability that z is between −1 and 2, P(−1<z<2), one would use the standard normal table. The area to the left of z=2 is approximately 0.9772, and the area to the left of z=−1 is approximately 0.1587. The desired probability is 0.9772−0.1587=0.8185.
8.3 Applications of the normal distribution
The normal distribution is often used to model real-world phenomena that are approximately normally distributed, such as human stature and intelligence. When a variable is known or assumed to be normally distributed, the z-transformation allows us to use standard normal tables to calculate probabilities.
Example: If the time children spend in an upright position follows a normal distribution with a mean of 5.4 hours and a standard deviation of 1.3 hours, the probability that a child spends less than 3.0 hours upright can be found by first calculating the z-score: z=1.33.0−5.4=1.3−2.4≈−1.85 Then, using a standard normal table, P(z<−1.85)≈0.0322.
This demonstrates that the normal distribution serves as a powerful tool for making probability statements about continuous variables in various fields, including health sciences.
8.4 Introduction to hypothesis testing
Hypothesis testing is a formal statistical procedure used to make decisions or draw conclusions about a population based on sample data. It involves formulating two competing statements about a population parameter and then using sample evidence to determine which statement is more likely to be true. The two fundamental statements are the null hypothesis (H0) and the alternative hypothesis (Ha or H1).
- Null Hypothesis (H0): This is a statement of "no effect," "no difference," or "no relationship." It typically represents the status quo or a claim to be tested. It always contains an equality sign (e.g., μ=100, p=0.5).
- Alternative Hypothesis (Ha): This is a statement that contradicts the null hypothesis. It represents what the researcher is trying to find evidence for. It can be one-sided (e.g., μ>100, p<0.5) or two-sided (e.g., μ=100, p=0.5).
The process of hypothesis testing involves:
- Stating the hypotheses: Clearly define H0 and Ha.
- Collecting data: Obtain a random sample from the population.
- Calculating a test statistic: This is a value computed from the sample data that measures how far the sample result deviates from the null hypothesis.
- Determining the p-value: The p-value is the probability of observing a test statistic as extreme as, or more extreme than, the one calculated, assuming the null hypothesis is true.
- Making a decision: Compare the p-value to a pre-determined significance level (α). If p≤α, reject H0. Otherwise, fail to reject H0.
Important: Failing to reject H0 does not mean H0 is true; it simply means there is not enough evidence to reject it at the chosen significance level.
The significance level (α) is the probability of making a Type I error (rejecting a true null hypothesis). Common values for α are 0.05 or 0.01.
8.5 Hypothesis testing for a single population mean
When testing a hypothesis about a single population mean (μ), we consider whether the sample mean (xˉ) is sufficiently different from the hypothesized population mean (μ0) to warrant rejecting H0.
The test statistic depends on whether the population standard deviation (σ) is known and the sample size (n):
- If σ is known: The test statistic follows a standard normal distribution (z-test). z=σ/nxˉ−μ0
- If σ is unknown and n is large (typically n≥30) or the population is normally distributed: The sample standard deviation (s) is used as an estimate for σ, and the test statistic also follows approximately a standard normal distribution (z-test). z=s/nxˉ−μ0
- If σ is unknown and n is small: The test statistic follows a t-distribution with n−1 degrees of freedom (t-test). t=s/nxˉ−μ0
Note: The t-distribution is similar to the normal distribution but has heavier tails, accounting for the extra uncertainty introduced by estimating σ with s.
Tip: The choice between a z-test and a t-test is crucial and depends on the availability of the population standard deviation and the sample size.
8.6 Hypothesis testing for a single population proportion
Hypothesis testing for a single population proportion (p) is used to assess claims about the proportion of individuals or items in a population that possess a certain characteristic. The null hypothesis is typically stated as H0:p=p0, where p0 is the hypothesized proportion.
The test statistic for a proportion is a z-score, calculated under the assumption that the null hypothesis is true: z=np0(1−p0)p^−p0 where p^ is the sample proportion (p^=x/n, with x being the number of successes in the sample and n being the sample size).
Conditions for using this test:
- The sample is random.
- The sample size is large enough such that np0≥10 and n(1−p0)≥10. This ensures that the sampling distribution of p^ is approximately normal.
Example: A researcher claims that less than 60% of adults prefer a certain brand of coffee. A random sample of 100 adults found that 55 preferred the brand. To test this claim, the hypotheses would be H0:p=0.60 and Ha:p<0.60. The test statistic would be calculated using p^=55/100=0.55.
8.7 Hypothesis testing for the difference between two population means
This type of hypothesis testing is used to determine if there is a significant difference between the means of two distinct populations. The null hypothesis is typically stated as H0:μ1=μ2 (or μ1−μ2=0), and the alternative hypothesis can be one-sided or two-sided.
The calculation of the test statistic depends on whether the population variances (σ12 and σ22) are known, whether the samples are independent or paired, and whether the population variances are assumed to be equal.
- Independent samples with known population variances: A z-test is used. z=n1σ12+n2σ22(xˉ1−xˉ2)−(μ1−μ2)0
- Independent samples with unknown population variances:
- If population variances are assumed to be equal: A pooled t-test is used, with a pooled variance estimate. The degrees of freedom are n1+n2−2.
- If population variances are not assumed to be equal: A Welch's t-test is used, which involves a more complex formula for degrees of freedom.
Reminder: The concept of sampling distributions is fundamental to hypothesis testing. The distributions of sample statistics (like the sample mean or proportion) under the null hypothesis allow us to calculate probabilities and make decisions.
This section introduces the fundamental concepts of sampling distributions and the initial steps of hypothesis testing, focusing on the distributions of sample means and proportions and the process for testing hypotheses about single population means and proportions.
8.8 Introduction to sampling distributions
A sampling distribution describes the probabilities of obtaining possible values of a statistic, which is a measure computed from a sample. Understanding sampling distributions is crucial for inferential statistics, as it allows us to make inferences about population parameters based on sample data. The Central Limit Theorem is a cornerstone concept, stating that for a sufficiently large sample size, the sampling distribution of the sample mean will be approximately normal, regardless of the population's distribution.
8.9 Distribution of the sample mean
The distribution of the sample mean, denoted as Xˉ, is a critical sampling distribution. If the population from which the sample is drawn is normally distributed with mean μ and standard deviation σ, then the sampling distribution of the sample mean Xˉ will also be normally distributed with a mean equal to the population mean (μXˉ=μ) and a standard deviation equal to the population standard deviation divided by the square root of the sample size, known as the standard error of the mean (σXˉ=nσ).
If the population distribution is not normal, the Central Limit Theorem (CLT) applies. The CLT states that for a sufficiently large sample size (typically n≥30), the sampling distribution of the sample mean Xˉ will be approximately normally distributed with mean μXˉ=μ and standard deviation σXˉ=nσ. This allows us to use normal distribution probabilities even when the population distribution is unknown or non-normal, provided the sample size is adequate 152.
Important: The Central Limit Theorem is fundamental for hypothesis testing and confidence interval construction, as it allows us to approximate the sampling distribution of the mean with a normal distribution under broad conditions.
8.10 Introduction to hypothesis testing
Hypothesis testing is a formal procedure used to make decisions about population parameters based on sample evidence. It involves setting up two competing hypotheses: a null hypothesis (H0) and an alternative hypothesis (Ha). The goal is to determine if there is enough evidence in the sample data to reject the null hypothesis in favor of the alternative hypothesis.
The general process of hypothesis testing involves:
- Stating the hypotheses: Formulating the null and alternative hypotheses.
- Choosing a significance level: Selecting a probability (denoted by α) that defines the threshold for rejecting the null hypothesis. Common values for α are 0.05, 0.01, or 0.10.
- Identifying the test statistic: Selecting an appropriate statistic from the sample data that will be used to test the hypothesis.
- Determining the critical region: Defining the range of values for the test statistic that would lead to the rejection of the null hypothesis.
- Calculating the test statistic: Computing the value of the test statistic from the sample data.
- Making a decision: Comparing the calculated test statistic to the critical region to decide whether to reject or fail to reject the null hypothesis.
Note: Failing to reject the null hypothesis does not mean it is true; it simply means there is insufficient evidence to conclude otherwise at the chosen significance level.
8.11 Hypothesis testing for a single population mean
When testing a hypothesis about a single population mean (μ), the null hypothesis is typically stated as H0:μ=μ0, where μ0 is a hypothesized value for the population mean. The alternative hypothesis can be one of three forms:
- Ha:μ=μ0 (two-tailed test)
- Ha:μ>μ0 (right-tailed test)
- Ha:μ<μ0 (left-tailed test)
The choice of test statistic depends on whether the population standard deviation (σ) is known and the sample size.
8.12 When the population standard deviation (σ) is known
If the population standard deviation σ is known and the population is normally distributed, or if the sample size is large (n≥30), the z-test is used. The test statistic is calculated as: where Xˉ is the sample mean, μ0 is the hypothesized population mean, σ is the population standard deviation, and n is the sample size.
8.13 When the population standard deviation (σ) is unknown
If the population standard deviation σ is unknown, we use the sample standard deviation (s) as an estimate. If the population is normally distributed or the sample size is large (n≥30), the t-test is employed. The test statistic is calculated as: This statistic follows a t-distribution with n−1 degrees of freedom. The t-distribution is similar to the normal distribution but has heavier tails, reflecting the added uncertainty from estimating σ with s.
Tip: For large sample sizes (n≥30), the t-distribution closely approximates the normal distribution, and the z-test can sometimes be used as an approximation even when σ is unknown. However, using the t-distribution is generally more appropriate.
8.14 Hypothesis testing for a single population proportion
Hypothesis testing can also be applied to population proportions. The null hypothesis is typically stated as H0:p=p0, where p0 is the hypothesized population proportion. The alternative hypothesis can be one of three forms:
- Ha:p=p0 (two-tailed test)
- Ha:p>p0 (right-tailed test)
- Ha:p<p0 (left-tailed test)
For a hypothesis test concerning a single population proportion, the sampling distribution of the sample proportion (p^) can be approximated by a normal distribution if the sample size is sufficiently large. The conditions for this approximation are that np0≥10 and n(1−p0)≥10.
The test statistic is a z-score, calculated as: where p^ is the sample proportion, p0 is the hypothesized population proportion, and n is the sample size.
Remember: The conditions np0≥10 and n(1−p0)≥10 are crucial for the validity of the normal approximation to the binomial distribution when testing proportions. If these conditions are not met, alternative methods may be required.
9. Sampling distributions and hypothesis testing (part 2)
This section delves into the fundamental concept of sampling distributions, explaining their construction, characteristics, and applications, particularly focusing on the distribution of the sample mean and the difference between two sample means, which are crucial for statistical inference.
9.1 Introduction to sampling distributions
A sampling distribution represents the distribution of all possible values that a specific statistic can assume, computed from samples of the same size drawn randomly from the same population. Understanding sampling distributions is paramount for statistical inference, as they enable us to answer probability questions about sample statistics and validate inference procedures.
Note: Sampling distributions can be constructed empirically for finite populations by drawing all possible samples of a given size, computing the statistic for each, and then determining the frequency of each distinct statistic value. However, for large or infinite populations, this is impractical and mathematical derivations or approximations through large numbers of samples are used 153 154.
9.2 Distribution of the sample mean
The distribution of the sample mean (xˉ) is a critical sampling distribution.
9.3 Construction and characteristics
When constructing the sampling distribution of the sample mean from a small, finite population (e.g., ages of five children: 6, 8, 10, 12, 14), by drawing all possible samples of a specific size (e.g., n=2) with replacement, we observe a distribution of sample means The mean of this sampling distribution, denoted as μxˉ, is equal to the population mean (μ), and its variance, denoted as σxˉ2, is equal to the population variance (σ2) divided by the sample size (n), i.e., σxˉ2=nσ2 The square root of this variance, σxˉ=nσ, is known as the standard error of the mean 156.
9.4 Sampling from normally distributed populations
If the population from which samples are drawn is normally distributed, the sampling distribution of the sample mean (xˉ) will also be normal. Its characteristics are:
- Mean: μxˉ=μ
- Variance: σxˉ2=nσ2
- Functional Form: Normal distribution
9.5 Sampling from nonnormally distributed populations: The Central Limit Theorem
The Central Limit Theorem (CLT) is fundamental when sampling from nonnormally distributed populations or when the population's functional form is unknown. It states that for a sufficiently large sample size (n), the sampling distribution of the sample mean (xˉ) will be approximately normally distributed, regardless of the population's original distribution The mean of this approximate sampling distribution remains μ, and the variance remains nσ2 157.
Important: A common rule of thumb suggests a sample size of n≥30 is often sufficient for the CLT to provide a good approximation to normality.
9.6 Sampling without replacement
When sampling without replacement from a finite population, the mean of the sampling distribution of xˉ is still μ. However, the variance is adjusted by a factor called the finite population correction (FPC) 158.
- Variance (sampling without replacement): σxˉ2=nσ2(N−1N−n), where N is the population size and n is the sample size.
The FPC, N−1N−n, is typically ignored when the sample size is small relative to the population size (e.g., when n/N≤0.05) 159.
9.7 Summary of sampling distribution of the sample mean
| Condition | Mean (μxˉ) | Standard Error (σxˉ) | Distribution |
|---|---|---|---|
| Normal population, known σ2 | μ | nσ | Normal |
| Nonnormal population, known σ2, large n | μ | nσ (if n/N≤0.05) or nσN−1N−n (otherwise) | Approximately Normal (CLT) |
| Finite population, sampling without replacement | μ | nσN−1N−n | Approximately Normal if n is large (CLT) |
Example: For a population with μ=185.6 mm and σ=12.7 mm, the probability of a sample of size n=10 having a mean greater than 190 mm is found by converting to a z-score: z=12.7/10190−185.6≈1.10. The probability P(xˉ>190) is then P(z>1.10)=0.1357 160 161.
9.8 Distribution of the difference between two sample means
When comparing two populations, the distribution of the difference between two sample means (xˉ1−xˉ2) is of interest.
9.9 Sampling from normally distributed populations
If both populations are normally distributed with means μ1,μ2 and variances σ12,σ22, the sampling distribution of the difference between sample means (xˉ1−xˉ2) is also normally distributed
- Mean: μxˉ1−xˉ2=μ1−μ2
- Variance: σxˉ1−xˉ22=n1σ12+n2σ22
The standard error of the difference between two means is σxˉ1−xˉ2=n1σ12+n2σ22.
Important: When considering the difference between two means, variances are always summed, even if the interest is in subtraction, provided the samples are independent 165.
9.10 Sampling from nonnormal or unknown populations
When sampling from nonnormal populations or when the population distributions are unknown, the Central Limit Theorem applies if the sample sizes (n1 and n2) are large. In such cases, the sampling distribution of the difference between sample means is approximately normally distributed with the same mean and variance as described above for normally distributed populations.
Example: For two client types with average home visit lengths of 45 minutes (SD 15) and 30 minutes (SD 20), with sample sizes n1=35 and n2=40, the probability of the average visit length differing by 20 or more minutes is calculated. The mean difference is 45−30=15 minutes. The variance of the difference is 35152+40202≈16.4286. The z-score for a difference of 20 is z=16.428620−15≈1.23. The probability P(difference≥20) is P(z≥1.23)=1−P(z<1.23)≈1−0.8907=0.1093 166 167.
This section details the sampling distribution of the sample proportion and the difference between two sample proportions, laying the groundwork for hypothesis testing involving proportions.
9.11 Distribution of the sample proportion
The sampling distribution of the sample proportion, denoted by p^, describes the distribution of proportions calculated from all possible simple random samples of a given size from a population. This is particularly relevant when dealing with categorical or count data where the outcome is dichotomous (e.g., obese/not obese, adequate/inadequate prenatal care).
Characteristics of the Sampling Distribution of p^:
- Approximation to Normal Distribution: For large sample sizes, the distribution of sample proportions is approximately normal due to the Central Limit Theorem.
- Mean: The mean of the sampling distribution of p^, denoted as mp^, is equal to the true population proportion, p. mp^=p
- Variance: The variance of the sampling distribution of p^, denoted as sp^2, is given by np(1−p), where p is the population proportion and n is the sample size. Let q=1−p. sp^2=npq
- Standard Error: The standard deviation of the sampling distribution of p^ is the standard error, sp^. sp^=npq
Conditions for Normal Approximation:
The use of the normal approximation for the sampling distribution of p^ is considered valid when both np and n(1−p) (or nq) are greater than 5.
Calculating Probabilities for p^:
To answer probability questions about p^, we can standardize the sample proportion to a z-score using the formula: z=npqp^−p
Example: If 35.7 percent of U.S. adults are obese (p=0.357), and we take a random sample of 150 individuals, the probability that the sample proportion of obese individuals (p^) is at least 0.40 can be calculated. First, check the condition for normal approximation: n⋅p=150⋅0.357=53.6>5 and n⋅q=150⋅(1−0.357)=150⋅0.643=96.5>5. The mean is p=0.357, and the variance is sp^2=1500.357⋅0.643≈0.00153. The z-score for p^=0.40 is z=0.001530.40−0.357≈1.10. The probability P(p^≥0.40)=P(z≥1.10)≈0.1357.
Correction for Continuity:
To improve the accuracy of the normal approximation for a discrete distribution (sample proportion) by a continuous distribution (normal curve), a continuity correction can be applied. This involves adjusting the value of p^ by 0.5.
- For calculating P(p^>value), we use P(p^>value+0.5/n).
- For calculating P(p^<value), we use P(p^<value−0.5/n).
- For calculating P(p^=value), we use P(value−0.5/n<p^<value+0.5/n).
The continuity correction formula for the z-score (zc) is: zc=npqx±0.5−np where x is the number of successes in the sample (x=np^), and the sign (±) depends on the direction of the inequality.
Note: While manual application of the continuity correction can be tedious, it is often handled automatically by statistical software 170.
9.12 Distribution of the difference between two sample proportions
This distribution is used when we are interested in comparing proportions from two independent populations.
Characteristics of the Sampling Distribution of p^1−p^2:
- Approximation to Normal Distribution: When both sample sizes (n1 and n2) are large, the distribution of the difference between two sample proportions, p^1−p^2, is approximately normal.
- Mean: The mean of this distribution is the difference between the two population proportions, p1−p2. mp^1−p^2=p1−p2
- Variance: The variance of the distribution is the sum of the variances of the individual sample proportions. sp^1−p^22=n1p1(1−p1)+n2p2(1−p2)
- Standard Error: The standard deviation of the sampling distribution is the standard error. sp^1−p^2=n1p1(1−p1)+n2p2(1−p2)
The normal approximation is appropriate if n1p1, n2p2, n1(1−p1), and n2(1−p2) are all greater than 5.
Construction of the Sampling Distribution:
To construct this distribution experimentally, one would draw all possible samples of size n1 from population 1 and calculate p^1 for each, and similarly draw all possible samples of size n2 from population 2 and calculate p^2 for each. Then, all possible differences between p^1 and p^2 values would be computed. For large or infinite populations, this process is approximated by taking a large number of independent random samples 172.
10. Sampling distributions and hypothesis testing (part 3)
This section focuses on the distribution of the difference between two sample proportions and introduces the foundational concepts of statistical estimation, setting the stage for hypothesis testing.
10.1 Distribution of the difference between two sample proportions
The sampling distribution of the difference between two sample proportions, denoted as p^1−p^2, is approximately normal under certain conditions, particularly when sample sizes are large. This distribution is crucial for comparing proportions from two independent populations.
Formula for the z-transformation of the difference between two sample proportions
The z-score for the difference between two sample proportions is calculated as follows: z=n1p1(1−p1)+n2p2(1−p2)(p^1−p^2)−(p1−p2) where:
- (p^1−p^2) is the observed difference between the sample proportions.
- (p1−p2) is the true difference between the population proportions (often assumed to be 0 under the null hypothesis in hypothesis testing).
- p1 and p2 are the population proportions.
- n1 and n2 are the sample sizes.
Note: This formula assumes that the two samples are independent and that the sample sizes are sufficiently large for the normal approximation to be valid. The conditions for this approximation are typically np≥10 and n(1−p)≥10 for each population.
Example: Difference in Lower Back Pain Incidence
Consider a survey where 28 percent of white subjects reported lower back pain, and 21 percent of Hispanic subjects reported the same. If independent random samples of size 100 are drawn from each population, the probability that the difference in sample proportions (p^1−p^2) is as large as 0.10 can be calculated.
- Mean of the sampling distribution: mp^1−p^2=p1−p2=0.28−0.21=0.07.
- Variance of the sampling distribution: sp^1−p^22=n1p1(1−p1)+n2p2(1−p2)=1000.28(0.72)+1000.21(0.79)=0.003675
- The z-score for a difference of 0.10 is: z=0.0036750.10−0.07≈0.06060.03≈0.49
- The probability of observing a difference of 0.10 or more is the area to the right of z=0.49 under the standard normal curve, which is approximately 0.3121 173.
Example: Calculating the probability that the difference in teeth loss percentages between two age groups is less than 5 percent. Given proportions of 0.34 for adults 75+ and 0.26 for adults 65-74, with sample sizes of 250 and 200 respectively.
- Mean difference: mp^1−p^2=0.34−0.26=0.08.
- Variance: sp^1−p^22=2500.34(0.66)+2000.26(0.74)=0.0009024+0.000962=0.0018644.
- The z-score for a difference of 0.05 is: z=0.00186440.05−0.08≈0.04318−0.03≈−0.70.
- The probability of the difference being less than 5 percent is the area to the left of z=−0.70, which is approximately 0.2420 174.
10.2 Introduction to Estimation
Estimation is a fundamental aspect of statistical inference, where sample statistics are used to approximate unknown population parameters.
Types of Estimates
- Point Estimate: A single numerical value used to estimate a population parameter. For example, the sample mean (xˉ) is a point estimate of the population mean (μ).
- Interval Estimate: A range of values that, with a specified degree of confidence, is likely to contain the population parameter. This provides more information than a point estimate by indicating the precision of the estimate.
Estimators and Their Properties
- Estimator: A rule or formula used to calculate an estimate. For instance, xˉ=n∑xi is an estimator for the population mean μ.
- Unbiased Estimator: An estimator T of a parameter μ is unbiased if its expected value, E(T), is equal to μ. This means that, on average, the estimator will yield the true parameter value. The sample mean (xˉ), sample proportion (p^), the difference between two sample means (xˉ1−xˉ2), and the difference between two sample proportions (p^1−p^2) are all unbiased estimators of their respective population parameters 181.
Important: The concept of unbiasedness is a desirable property for an estimator, ensuring that the estimation process is centered around the true population parameter.
Sampled Population vs. Target Population
- Sampled Population: The population from which the sample is actually drawn.
- Target Population: The population about which the researcher wishes to make an inference.
Caution: Inferences are strictly valid only for the sampled population. To make inferences about a different target population, nonstatistical considerations (e.g., known similarities between populations) must be used to justify the extrapolation.
Random vs. Nonrandom Samples
The validity of statistical inference procedures relies heavily on the assumption that samples are random.
- Random Samples: Samples selected such that every member of the population has an equal chance of being included.
- Nonrandom Samples (Convenience Samples): Samples selected based on ease of access or availability (e.g., volunteers, students in a class). Generalizations from convenience samples to a broader population require careful nonstatistical reasoning.
10.3 Confidence Interval for a Population Mean
When a population mean (μ) is unknown, it can be estimated using an interval that quantifies the uncertainty associated with the estimate.
Constructing a Confidence Interval
A confidence interval for a population mean (μ) is typically constructed around a point estimate, such as the sample mean (xˉ). The general form of an interval estimate is:
estimator ± (reliability coefficient) × (standard error)
For a normally distributed population with a known variance, a confidence interval for μ is given by: xˉ±z1−α/2sxˉ
- xˉ is the sample mean (point estimate).
- z1−α/2 is the reliability coefficient, a value from the standard normal distribution corresponding to the desired confidence level. It represents the number of standard errors from the mean that capture a specified proportion of the distribution.
- sxˉ=ns is the standard error of the mean.
Example: Estimating the mean enzyme level with a sample mean xˉ=22 from a sample of size n=10 from a normally distributed population with a variance σ2=45. For a 95 percent confidence interval:
- Standard error: sxˉ=1045≈2.1213.
- Reliability coefficient for 95% confidence (1−α=0.95, so α/2=0.025): z0.975≈1.96 (often approximated as 2).
- Confidence interval: 22±1.96(2.1213)≈22±4.16⟹[17.84,26.16].
- The text uses 2 as an approximation for the reliability coefficient, yielding the interval [17.76,26.24] 184.
Interpretation of Confidence Intervals
There are two main ways to interpret a confidence interval:
- Probabilistic Interpretation: If we were to repeatedly draw samples and construct confidence intervals, 100(1−α) percent of these intervals would, in the long run, contain the true population mean (μ).
- Practical Interpretation: For a single computed interval, we are 100(1−α) percent confident that the interval contains the population mean (μ).
The quantity 1−α is known as the confidence coefficient or confidence level. Common confidence levels are 90%, 95%, and 99%, with associated reliability coefficients (z-values) of approximately 1.645, 1.96, and 2.58, respectively 185.
This section delves into the construction of confidence intervals for a population mean, addressing scenarios where the population variance is known and unknown, and introducing the t-distribution for small sample sizes when the population variance is unknown.
10.4 Confidence intervals for a population mean when population variance is known
When estimating a population mean (μ), a confidence interval provides a range of values within which the true population mean is likely to lie, with a certain level of confidence. If the population is approximately normally distributed with a known variance (σ2), or if the sample size is large (due to the Central Limit Theorem), the confidence interval for μ can be constructed using the z-distribution.
The general form of a confidence interval is: estimator±(reliability coefficient)×(standard error of the estimator)
For a population mean, when σ2 is known, this becomes: xˉ±zα/2nσ
- xˉ is the sample mean.
- zα/2 is the reliability coefficient from the standard normal distribution, corresponding to the desired confidence level (1−α).
- σ is the known population standard deviation.
- n is the sample size.
- nσ is the standard error of the mean.
The precision, or margin of error, of the estimate is given by zα/2nσ. This is the quantity multiplied by the reliability factor and added/subtracted from the sample mean to define the interval bounds.
Example: A physical therapist wants to estimate the mean maximal muscle strength in a group of individuals with 99 percent confidence. Assuming strength scores are normally distributed with a known variance of 144 (σ=12), a sample of 15 subjects yielded a mean of 84.3. The z-value for 99 percent confidence is 2.58. The standard error is 1512≈3.0984. The 99 percent confidence interval is 84.3±2.58(3.0984), resulting in an interval of (76.3, 92.3).
10.5 Handling non-normal populations and unknown variances
The Central Limit Theorem is crucial when the population distribution is not normal but the sample size is large (n>30). In such cases, the sampling distribution of the sample mean (xˉ) is approximately normal, allowing the use of z-distribution-based confidence intervals if the population standard deviation (σ) is known 186.
When the population variance is unknown but the sample size is large, the sample standard deviation (s) is used as an estimate for σ in the confidence interval formula. The formula then becomes: xˉ±zα/2ns This approach is justified because for large sample sizes, s is a reliable approximation of σ.
Note: Computer software packages can significantly expedite the construction of confidence intervals by automating calculations from raw data 187.
10.6 Robust estimators and alternative measures of central tendency
The sample mean can be sensitive to extreme values (outliers). In such situations, alternative estimators like the median or the trimmed mean may be preferred.
- Median: Less sensitive to outliers than the mean, making it a suitable estimator for the population median when outliers are present.
- Trimmed Mean: A robust estimator that involves ordering the data, discarding a specified percentage of the smallest and largest measurements, and then calculating the mean of the remaining values. A trimmed mean with a = 0.1 or a = 0.2 is generally recommended. The median can be considered a 50 percent trimmed mean.
10.7 The t distribution for small samples with unknown population variance
A significant challenge arises when constructing confidence intervals for a population mean with small sample sizes and an unknown population variance (σ2). In this scenario, the z-distribution cannot be strictly applied because the standard error nσ involves the unknown σ. Instead, the sample standard deviation (s) is used to estimate σ, leading to the statistic: t=s/nxˉ−μ This statistic follows Student's t-distribution.
10.8 Properties of the t distribution
The t-distribution, developed by "Student" (William Sealy Gosset), shares characteristics with the normal distribution but is a family of distributions, each dependent on the degrees of freedom (df).
Key properties include:
- Mean: The mean of the t-distribution is 0.
- Symmetry: It is symmetrical about its mean .
- Variance: The variance is generally greater than 1 but approaches 1 as the sample size increases. For df > 2, the variance is df−2df. With df = n-1, the variance is n−3n−1 for n > 3.
- Range: The variable t ranges from −∞ to +∞.
- Family of Distributions: A unique distribution exists for each value of degrees of freedom (df=n−1). Figure 6.3.1 illustrates how the t-distribution becomes more peaked and its tails become thinner as df increases 190.
- Shape: Compared to the normal distribution, the t-distribution is less peaked at the center and has heavier or thicker tails.
- Approximation to Normal: As the degrees of freedom approach infinity (n→∞), the t-distribution converges to the standard normal distribution.
Comparison: Figure 6.3.2 visually contrasts the t-distribution with the normal distribution, highlighting the fatter tails of the t-distribution.
10.9 Constructing confidence intervals using the t distribution
When constructing a confidence interval for a population mean (μ) under the conditions of a normal population with unknown variance and a small sample size, the formula is: xˉ±tα/2,dfns
- tα/2,df is the reliability coefficient obtained from the t-distribution table, corresponding to the desired confidence level (1−α) and the degrees of freedom (df=n−1). The subscript α/2 indicates the area in each tail of the distribution.
- s is the sample standard deviation.
- ns is the estimated standard error of the mean.
Requirement: The strict theoretical validity of the t-distribution requires the sample to be drawn from a normally distributed population. However, moderate deviations from normality are generally tolerated, especially if the population distribution is mound-shaped 191.
Example: For 19 subjects, the mean isometric gastrocsoleus muscle strength was 250.8 with a standard deviation of 130.9. To construct a 95 percent confidence interval for the population mean, assuming the population is approximately normal:
- The standard error is 19130.9≈30.0305.
- The degrees of freedom are df=19−1=18.
- The t-value for a 95 percent confidence interval (α=0.05, α/2=0.025) with 18 df is t0.025,18=2.1009 (obtained from a t-table).
- The 95 percent confidence interval is 250.8±2.1009(30.0305), resulting in 250.8±63.1, which is (187.7, 313.9).
10.10 Deciding between z and t for reliability factors
The choice between using a z-value or a t-value as the reliability factor depends on several factors:
- Sample size: Large samples (n>30) often allow for the use of z, especially if the population variance is known or estimated reliably. Small samples typically necessitate the use of t.
- Normality of the sampled population: If the population is known to be normal, t is appropriate for unknown variance. If non-normal, large sample sizes are needed to approximate normality.
- Knowledge of population variance: If σ2 is known, z is used. If σ2 is unknown, s is used, and t is generally preferred for small samples from normal or near-normal populations.
Flowchart: A flowchart (Figure 6.3.3) can guide the decision-making process for selecting the appropriate reliability factor (z or t) when constructing confidence intervals for a population mean.
Computer Analysis: Software like MINITAB offers commands such as
ZINTERVAL(for known σ) andTINTERVAL(for unknown σ) to construct confidence intervals, streamlining the process 188 192.
11. Sampling distributions and hypothesis testing (part 4)
This section details the construction and interpretation of confidence intervals for population means and proportions, as well as the difference between two population means and proportions, based on sample data.
11.1 Confidence interval for a population mean
A confidence interval for a population mean (μ) is constructed using sample data. The general formula for a confidence interval is: estimator ± (reliability coefficient) * (standard error of the estimator).
- Point Estimate: The sample mean (xˉ) is used as the point estimate for the population mean (μ).
- Standard Error: The standard error of the sample mean (σxˉ) is estimated by sxˉ=ns, where s is the sample standard deviation and n is the sample size.
- Reliability Factor: The choice of the reliability factor depends on the available information about the population variance and the sample size:
- If the population is normally distributed and the population variance (σ2) is known, or if the sample size (n) is large (typically n≥30), the z-distribution is used. The reliability factor is zα/2.
- If the population is normally distributed, the population variance (σ2) is unknown, and the sample size is small (n<30), the t-distribution is used. The reliability factor is tα/2 with n−1 degrees of freedom.
The formula for a confidence interval for μ is:
- When σ2 is known or n is large: xˉ±zα/2ns
- When σ2 is unknown and n is small: xˉ±tα/2,n−1ns
Example: For a sample of 8 subjects with Category Fluency Test scores (11, 10, 6, 3, 11, 10, 9, 11), the point estimate of the population mean is xˉ=9.75. The sample standard deviation is s=3.29. For a 95% confidence interval, assuming the population is normally distributed and the variance is unknown, we use the t-distribution with n−1=7 degrees of freedom. The reliability factor t0.025,7 is 2.3646. The estimated standard error is sxˉ=83.29≈1.163. The 95% confidence interval is 9.75±2.3646(1.163)≈9.75±2.75, resulting in the interval (7.00, 12.50) [ 194.
Note: The precision of an estimate refers to the width of the confidence interval. A narrower interval indicates a more precise estimate. The probabilistic interpretation of a confidence interval states that if many samples were taken and intervals constructed, a certain percentage (e.g., 95%) of those intervals would contain the true population parameter. The practical interpretation relates this to the likely range of the parameter.
A flowchart (Figure 6.3.3) is provided to guide the selection of the appropriate statistic (z or t) for inferences about population means based on whether the population is normally distributed, population variance is known, and sample size is large [ ] 193.
11.2 Confidence interval for the difference between two population means
When interested in estimating the difference between two population means (μ1−μ2), independent random samples are drawn from each population. The difference between sample means (xˉ1−xˉ2) is an unbiased estimator.
The variance of the estimator is n1σ12+n2σ22. The construction of the confidence interval depends on assumptions about population normality, known variances, and sample sizes.
-
Case 1: Population variances are known. If both populations are normally distributed or if sample sizes (n1,n2) are large, the confidence interval is: (xˉ1−xˉ2)±zα/2n1σ12+n2σ22
Example: For individuals with Down's syndrome (xˉ1=4.5, σ12=1, n1=12) and normal individuals (xˉ2=3.4, σ22=1.5, n2=15), the point estimate is 1.1. The 95% reliability factor is z0.025=1.96. The standard error is 121+151.5≈0.4282. The 95% confidence interval is 1.1±1.96(0.4282)≈1.1±0.84, resulting in the interval (0.26, 1.94) [ 196. Since this interval does not contain zero, it suggests the population means are not equal 195.
-
Case 2: Population variances are unknown.
-
Subcase 2a: Population variances are assumed to be equal (σ12=σ22). If both populations are normally distributed, a pooled estimate of the common variance (sp2) is calculated: sp2=n1+n2−2(n1−1)s12+(n2−1)s22 The standard error is sxˉ1−xˉ2=sp2(n11+n21). The confidence interval uses the t-distribution with n1+n2−2 degrees of freedom: (xˉ1−xˉ2)±tα/2,n1+n2−2sp2(n11+n21)
Example: For schizophrenia patients (mean=4.7, s2=9.32, n=18) and bipolar disorder patients (mean=8.8, s2=11.52, n=10), assuming equal variances and normal populations. The pooled variance is sp2=18+10−2(18−1)9.32+(10−1)11.52≈102.33. With 26 degrees of freedom and a 95% confidence level, t0.025,26=2.0555. The confidence interval is 4.7−8.8±2.055518102.33+10102.33≈−4.1±8.20, yielding (-12.3, 4.1). Since the interval includes zero, the population means may be equal [ 198 197.
-
Subcase 2b: Population variances are not equal. If populations are normally distributed but variances are unequal, a modified reliability factor (t0′) can be used. One method, proposed by Cochran, involves a weighted average of t-values from separate degrees of freedom: t0′=w1+w2w1t1+w2t2 where w1=s12/n1, w2=s22/n2, t1=tα/2 with n1−1 degrees of freedom, and t2=tα/2 with n2−1 degrees of freedom. The confidence interval is: (xˉ1−xˉ2)±t0′n1s12+n2s22
Example: Using the same data as the previous example but assuming unequal variances. For a 95% interval, t1=t0.025,17=2.1098 and t2=t0.025,9=2.2622. The weighted reliability factor is t0′≈2.2216. The confidence interval is −4.1±2.2216189.32+1011.52≈−4.1±2.2216(4.246)≈−4.1±9.43, resulting in (-13.5, 5.3) [ 200 199.
-
-
Large sample sizes (regardless of population normality). If sample sizes are large, the Central Limit Theorem allows the use of the z-distribution even if population variances are unknown and estimated by sample variances: (xˉ1−xˉ2)±zα/2n1s12+n2s22
Example: For smoking cessation program participants (mean=4.3, s=5.22, n=328) and non-completers (mean=13.0, s=8.97, n=64). The point estimate is −8.7. For a 99% interval, z0.005=2.58. The estimated standard error is 3285.222+648.972≈1.1577. The confidence interval is −8.7±2.58(1.1577)≈−8.7±2.99, yielding (-11.7, -5.7) [ ] 196.
Figure 6.4.1 provides a flowchart to aid in selecting the appropriate reliability factor (z, t, or t0′) for inferences about the difference between two population means [ ] 200.
11.3 Confidence interval for a population proportion
A confidence interval for a population proportion (p) is constructed using sample data.
- Point Estimate: The sample proportion (p^) is used as the point estimate for the population proportion (p).
- Standard Error: The standard error of the sample proportion is estimated by s^p^=np^(1−p^). This approximation is valid when np^≥5 and n(1−p^)≥5.
- Reliability Factor: The z-distribution is used, with the reliability factor being zα/2.
The confidence interval is given by: p^±zα/2np^(1−p^)
Example: In 2003, 18% of adult Internet users searched for information on experimental treatments. With a sample size of n=1220, the point estimate is p^=0.18. The conditions np^=1220×0.18≈219.6>5 and n(1−p^)=1220×0.82≈1000.4>5 are met. For a 95% confidence interval, z0.025=1.96. The estimated standard error is 12200.18(0.82)≈0.0110. The confidence interval is 0.18±1.96(0.0110)≈0.18±0.022, resulting in (0.158, 0.202) [ 204 203.
Reminder: The reliability coefficient can differ across exercises due to variations in the desired confidence level (e.g., 90%, 95%, 99%), which determines the value of α and thus α/2 for the z-score.
11.4 Confidence interval for the difference between two population proportions
When comparing two population proportions (p1 and p2), the difference between sample proportions (p^1−p^2) serves as an unbiased point estimator.
- Standard Error: The estimated standard error of the difference between sample proportions is: s^p^1−p^2=n1p^1(1−p^1)+n2p^2(1−p^2) This is applicable when sample sizes are large and population proportions are not extremely close to 0 or 1.
(p^1−p^2)±zα/2n1p^1(1−p^1)+n2p^2(1−p^2)
Example: In a study of sexual abuse, 31 out of 68 females (p^F=0.4559) and 53 out of 255 males (p^M=0.2078) reported abuse. The difference in proportions is p^F−p^M=0.2481. For a 99% confidence interval, z0.005=2.58. The estimated standard error is 680.4559(0.5441)+2550.2078(0.7922)≈0.0655. The confidence interval is 0.2481±2.58(0.0655)≈0.2481±0.1690, resulting in (0.0791, 0.4171) [ ] 205.
This section delves into the critical aspects of determining appropriate sample sizes for estimating population parameters and provides the foundational understanding for constructing confidence intervals for population variances.
11.5 Sample size determination for estimating means
Determining the appropriate sample size is a crucial step in planning any statistical study to ensure efficiency and utility of the results. The goal in interval estimation is to achieve narrow intervals with high reliability. The width of a confidence interval is influenced by the reliability coefficient and the standard error of the estimator. The precision, or margin of error (d), is half the width of the interval.
To reduce the interval width while maintaining a fixed reliability coefficient, the standard error must be reduced. Since the standard error for a sample mean is typically given by σ/n, reducing the standard error necessitates increasing the sample size (n).
The formula for determining the sample size (n) for estimating a population mean depends on whether sampling is with or without replacement, and whether a finite population correction is needed.
-
For sampling with replacement, from an infinite population, or when the finite population correction can be ignored: The margin of error (d) is related to the reliability coefficient (z) and the standard error by: d=znσ Solving for n, we get: n=d2z2σ2 where:
- z is the reliability coefficient corresponding to the desired confidence level.
- σ is the population standard deviation.
- d is the desired margin of error (half the desired interval width).
-
When sampling without replacement from a small finite population: The formula incorporating the finite population correction is: d=znσN−1N−n Solving for n, the formula becomes: n=d2(N−1)+z2σ2Nz2σ2 If the finite population correction can be ignored (i.e., when N is large relative to n), this formula simplifies to the one above for sampling with replacement.
Note: When calculating sample size using these formulas, if the result is not an integer, it should always be rounded up to the next whole number to ensure the desired precision and confidence level are met.
11.6 Estimating the population standard deviation (σ)
A significant challenge in sample size determination is that the population standard deviation (σ) is usually unknown. Estimates for σ2 (and thus σ) can be obtained from:
- A pilot or preliminary sample: The variance calculated from a small initial sample can be used as an estimate of the population variance. Observations from this pilot sample can be included in the final sample.
- Previous or similar studies: Data from prior research may provide a reasonable estimate of the population variance.
- Range approximation: If the population is approximately normally distributed, the range (difference between the largest and smallest values) can be used, with σ≈Range/6.
Example: A health department nutritionist wants to estimate the average daily protein intake of teenage girls. They desire a confidence interval width of 10 grams (so d=5 grams), a confidence coefficient of 0.95 (z=1.96), and estimate the population standard deviation to be 20 grams. Using the formula for large populations: n = \frac{(1.96)^2 ^2}{ ^2} = \frac{3.8416 \times 400}{25} = 61.47 20 5. Thus, a sample size of 62 would be recommended.
11.7 Sample size determination for estimating proportions
The methodology for determining sample size when estimating a population proportion is analogous to that for estimating a population mean. The core principle remains setting half the desired interval width (d) equal to the product of the reliability coefficient and the standard error of the proportion.
The sample size ($n$) is given by:
$$n = \frac{z^2 \hat{p}\hat{q}}{d^2}$$
* $z$ is the reliability coefficient.
* $\hat{p}$ is an estimate of the population proportion.
* $\hat{q} = 1 - \hat{p}$.
* $d$ is the desired margin of error.
- When the finite population correction cannot be disregarded: The sample size (n) is calculated as: n=d2(N−1)+z2p^q^Nz2p^q^ where N is the population size.
Important: If n/N≤0.05, the finite population correction can generally be ignored, and Equation 6.8.1 can be used.
11.8 Estimating the population proportion (p^)
Since p^ is the parameter being estimated, it is unknown. Strategies for estimating p^ include:
- Pilot sample: Compute p^ from a preliminary sample.
- Upper bound estimation: If a plausible upper bound for p is known (e.g., the proportion of a disability cannot exceed 0.30), use this value.
- Setting p^=0.5: If no better estimate is available, setting p^=0.5 yields the largest possible sample size for the desired reliability and interval width. This ensures the sample is large enough but may be more expensive than necessary.
Example: A survey plans to determine the proportion of medically indigent families, believing the proportion is no more than 0.35. A 95 percent confidence interval with d=0.05 is desired. Assuming the finite population correction can be ignored: n=(0.05)2(1.96)2(0.35)(0.65)=0.00253.8416×0.2275=349.59 The recommended sample size is 350 families.
11.9 Confidence interval for the variance of a normally distributed population
The sample variance (s2) is a commonly used point estimator for the population variance (σ2). The quality of this estimator is assessed, particularly its unbiasedness.
-
Unbiasedness of the sample variance (s2): The sample variance, defined as s2=n−1∑(xi−xˉ)2, is an unbiased estimator of the population variance σ2 when sampling is with replacement from an infinite population. This means that the expected value of s2 over all possible samples is equal to σ2, i.e., E(s2)=σ2.
When sampling is without replacement from a finite population, the sample variance calculated using n−1 in the denominator (S2=N−1∑(xi−xˉ)2) is used, and its expected value is the population variance σ2. However, the calculation commonly referred to as the "sample variance" (s2) when sampling without replacement would have an expected value related to the population variance σ2. The text indicates that when sampling is without replacement, E(s2)=S2=N−1∑(xi−μ)2, where μ is the population mean. However, the example calculations on pages 211-212 clarify that E(s2)=σ2 for sampling with replacement and E(s2)=S2 for sampling without replacement, where S2 is the population variance calculated with N−1 in the denominator. For large N, N−1≈N, so s2 and S2 are approximately equal.
It is important to note that while s2 is an unbiased estimator of σ2, the sample standard deviation (s) is not an unbiased estimator of the population standard deviation (σ), although this bias diminishes rapidly with increasing sample size.
-
Interval Estimation of Population Variance: Constructing a confidence interval for the population variance requires identifying an appropriate sampling distribution. The distribution of the sample variance, when sampling from a normally distributed population, is related to the chi-square (χ2) distribution. Specifically, the quantity σ2(n−1)s2 follows a chi-square distribution with n−1 degrees of freedom. This relationship forms the basis for constructing confidence intervals for σ2.
A confidence interval for σ2 can be derived using the critical values from the chi-square distribution. For a (1−α) confidence level, the interval is: (χα/2,n−12(n−1)s2,χ1−α/2,n−12(n−1)s2) where χα/2,n−12 and χ1−α/2,n−12 are the critical values from the chi-square distribution with n−1 degrees of freedom, leaving α/2 in each tail.
12. Sampling distributions and hypothesis testing (part 5)
This section of the study guide focuses on constructing confidence intervals for population variances and the ratio of two population variances, building upon the foundational concepts of sampling distributions.
12.1 Confidence interval for the variance of a normally distributed population
When dealing with normally distributed populations, confidence intervals for the population variance (σ2) and standard deviation (σ) can be constructed using the sampling distribution of σ2n−1s2, which follows a chi-square (χ2) distribution with n−1 degrees of freedom.
- The Chi-Square Distribution: This distribution is characterized by its shape, which depends on the degrees of freedom (df), and is always positive. It is used to determine confidence intervals for population variances when the population is assumed to be normally distributed 213.
- Constructing the Confidence Interval for σ2:
- The 100(1-α)% confidence interval for σ2 is given by: χα/2,n−12(n−1)s2<σ2<χ1−α/2,n−12(n−1)s2 where s2 is the sample variance, n is the sample size, and χα/2,n−12 and χ1−α/2,n−12 are the critical values from the chi-square distribution with n−1 degrees of freedom, such that α/2 of the area is in each tail.
- Rearranging the inequality gives: χ1−α/2,n−12(n−1)s2<σ2<χα/2,n−12(n−1)s2.
- Constructing the Confidence Interval for σ: By taking the square root of the confidence interval for σ2, we obtain the confidence interval for the population standard deviation σ: χ1−α/2,n−12(n−1)s2<σ<χα/2,n−12(n−1)s2 214.
Note: The assumption of population normality is critical for the validity of these intervals. The chi-square distribution is not symmetric, which leads to confidence intervals for variance that are not centered around the sample variance.
12.2 Confidence interval for the ratio of the variances of two normally distributed populations
Comparing the variances of two populations is often of interest, and this can be achieved by forming their ratio. The F distribution is used to construct confidence intervals for the ratio of two population variances when independent samples are drawn from two normally distributed populations.
- The F Distribution: The F distribution is characterized by two sets of degrees of freedom: numerator degrees of freedom (df1) and denominator degrees of freedom (df2). The distribution of the ratio of two sample variances, s22/σ22s12/σ12, follows an F distribution with df1=n1−1 and df2=n2−1 degrees of freedom 217.
- Constructing the Confidence Interval for σ12/σ22:
- The 100(1-α)% confidence interval for the ratio of population variances (σ12/σ22) is given by: s22s12Fα/2,df1,df21<σ22σ12<s22s12Fα/2,df2,df1 where s12 and s22 are the sample variances, n1 and n2 are the sample sizes, df1=n1−1, df2=n2−1, and Fα/2,df1,df2 and Fα/2,df2,df1 are critical values from the F distribution.
- A useful relationship for finding the lower tail critical values is: Fα,df1,df2=F1−α,df2,df11. This allows the calculation of lower percentile F-values using tables that typically provide upper percentile values.
Important: The assumption that the sampled populations are normally distributed is crucial for the validity of this confidence interval. If normality cannot be assumed, alternative tests like Levene's test, which uses measures of distance from a sample median, can be employed 219.
- Interpretation: If the confidence interval for the ratio of variances includes 1, it suggests that the two population variances may be equal.
Example: In Example 6.10.1, a 95 percent confidence interval for the ratio of BMI variances between women and men was calculated as.1323 to 7.8221. Since this interval includes 1, the conclusion is that the population variances may be equal 218.
This section details the foundational concepts of sampling distributions for various statistics and introduces the framework for hypothesis testing, focusing on single and two-sample mean scenarios.
12.3 Introduction to Sampling Distributions and Hypothesis Testing
This part of the study guide bridges the concepts of sampling distributions and hypothesis testing. It lays the groundwork for making inferences about population parameters based on sample data. The focus is on understanding the behavior of sample statistics when repeated samples are drawn from a population and then applying this understanding to formally test claims about these populations.
12.4 Hypothesis testing framework
Hypothesis testing is a statistical method used to make decisions or draw conclusions about a population based on sample data. It involves formulating a claim (hypothesis) about a population parameter and then using sample evidence to determine if the claim is likely to be true.
Note: Hypothesis testing and interval estimation are closely related statistical inference techniques, often leading to similar conclusions.
12.5 Key concepts in hypothesis testing
- Null Hypothesis (H0): A statement about a population parameter that is assumed to be true until evidence suggests otherwise. It typically represents a status quo, no effect, or no difference.
- Alternative Hypothesis (Ha or H1): A statement that contradicts the null hypothesis. It represents what we are trying to find evidence for.
- Test Statistic: A value calculated from sample data that measures how far the sample statistic deviates from the value specified in the null hypothesis.
- Significance Level (α): The probability of rejecting the null hypothesis when it is actually true (Type I error). Common values are 0.05, 0.01, or 0.10.
- P-value: The probability of observing a test statistic as extreme as, or more extreme than, the one calculated from the sample data, assuming the null hypothesis is true.
- Decision Rule: A criterion for deciding whether to reject or fail to reject the null hypothesis, typically based on comparing the p-value to the significance level or comparing the test statistic to a critical value.
12.6 Hypothesis testing for a single population mean
This section outlines the procedure for testing hypotheses about a population mean (μ).
12.7 Steps for hypothesis testing of a single population mean
-
State the null and alternative hypotheses:
- H0:μ=μ0
- Ha:μ=μ0 (two-tailed test)
- Ha:μ>μ0 (right-tailed test)
- Ha:μ<μ0 (left-tailed test) where μ0 is the hypothesized population mean.
-
Choose a significance level (α): This determines the risk of making a Type I error.
-
Select the appropriate test statistic:
- If the population standard deviation (σ) is known or the sample size is large (n≥30), use the z-test: z=σ/nxˉ−μ0
- If the population standard deviation (σ) is unknown and the sample size is small (n<30), use the t-test (assuming the population is approximately normally distributed): t=s/nxˉ−μ0 where xˉ is the sample mean, s is the sample standard deviation, and n is the sample size. The degrees of freedom for the t-test are df=n−1.
-
Determine the critical region or calculate the p-value:
- Critical Region: Identify the range of test statistic values that would lead to rejecting H0. This is determined by the significance level and the type of test (one-tailed or two-tailed).
- P-value: Calculate the probability of obtaining the observed sample result or a more extreme one, assuming H0 is true.
-
Make a decision:
- If the calculated test statistic falls within the critical region, or if the p-value is less than or equal to α, reject H0.
- Otherwise, fail to reject H0.
-
Interpret the results: State the conclusion in the context of the problem.
Remember: When the population standard deviation (σ) is unknown and the sample size is small, the t-distribution is used. The t-distribution accounts for the additional uncertainty introduced by estimating σ with s.
12.8 Hypothesis testing for the difference between two population means
This section covers hypothesis testing when comparing the means of two independent populations.
12.9 Steps for hypothesis testing of the difference between two population means
* $H_0: \mu_1 - \mu_2 = d_0$
* $H_a: \mu_1 - \mu_2 \neq d_0$ (two-tailed)
* $H_a: \mu_1 - \mu_2 > d_0$ (right-tailed)
* $H_a: \mu_1 - \mu_2 < d_0$ (left-tailed)
where $d_0$ is the hypothesized difference between the population means (often $d_0=0$).
2. Choose a significance level (α):
-
Select the appropriate test statistic: The choice depends on whether the population variances are assumed to be equal or unequal.
-
Case 1: Population variances are assumed to be equal (σ12=σ22). Use a pooled variance (sp2): sp2=n1+n2−2(n1−1)s12+(n2−1)s22 The test statistic is a t-statistic: t=spn11+n21(xˉ1−xˉ2)−d0 The degrees of freedom are df=n1+n2−2.
-
Case 2: Population variances are assumed to be unequal (σ12=σ22). This is known as Welch's t-test. The test statistic is a t-statistic, but the degrees of freedom are calculated using the Welch-Satterthwaite equation, which is complex: t=n1s12+n2s22(xˉ1−xˉ2)−d0 The degrees of freedom are approximated by: df≈n1−1(s12/n1)2+n2−1(s22/n2)2(n1s12+n2s22)2
-
Large sample sizes (n1≥30 and n2≥30): A z-test can be used even if population variances are unknown, as the sample variances provide good estimates. z=n1s12+n2s22(xˉ1−xˉ2)−d0
-
-
Determine the critical region or calculate the p-value: Similar to the single-sample case, using the appropriate distribution (t or z) and degrees of freedom if applicable.
-
Make a decision: Reject H0 if the test statistic falls in the critical region or if the p-value ≤α.
Important: The assumption of equal or unequal variances significantly impacts the calculation of the test statistic and degrees of freedom for two-sample t-tests. If in doubt or if there's evidence against equality of variances, Welch's t-test (unequal variances) is generally preferred as it is more robust.
12.10 Examples and applications
The provided document content includes several exercises (Exercises 22-38 and the large data set exercises) that apply these hypothesis testing principles to real-world scenarios. These examples involve comparing means or proportions from various studies, such as:
- Saliva pH levels in school children (Exercise 22).
- Hours of sleep after different drug treatments (Exercise 23).
- Time to active labor for different labor induction methods (Exercise 24).
- Fasting nonesterified fatty acids (NEFA) levels (Exercise 25).
- Proportions of smokers in different groups (Exercise 26).
- Prevalence of vitamin D deficiency (Exercise 27).
- Linoleic acid levels in subjects with and without myocardial infarction (Exercise 28).
- Salivary flow rates (Exercise 29).
- Maximum urethral closure pressure after different surgical procedures (Exercise 30).
These examples require careful application of the hypothesis testing steps, including formulating hypotheses, choosing the correct test, calculating the test statistic, and interpreting the results in the context of the study.
Tip: When approaching these problems, first identify the population(s) and parameter(s) of interest. Then, determine whether you are dealing with one sample or two, and whether the parameter is a mean or a proportion. This will guide you to the correct hypothesis testing procedure.
13. Sampling distributions and hypothesis testing (part 6)
This section introduces the fundamental concepts of hypothesis testing as a method of statistical inference, building upon the understanding of sampling distributions.
13.1 Introduction to hypothesis testing
Hypothesis testing is a statistical method used to make decisions about a population based on sample data, serving as the counterpart to estimation. It aids clinicians, researchers, and administrators in drawing conclusions by examining a sample from the population of interest. The core idea is to determine if a statement about a population parameter is compatible with the observed data.
13.2 Basic concepts
- Hypothesis: A statement about one or more populations, often concerning their parameters. For example, a hospital administrator might hypothesize that the average patient length of stay is 5 days.
- Research hypothesis: The conjecture or supposition that initiates the research, often based on prior observations or suspicions.
- Statistical hypothesis: Hypotheses formulated in a way that can be evaluated using statistical techniques. These are the focus of hypothesis testing procedures.
13.3 Steps in hypothesis testing
A structured ten-step procedure helps break down the hypothesis testing process:
- Data: Understand the nature of the data (e.g., counts or measurements), as this dictates the appropriate statistical test.
- Assumptions: Identify and review assumptions relevant to the test, similar to those used in estimation (e.g., normality of population distribution, equality of variances, independence of samples).
- Hypotheses:
- Null Hypothesis (H0): The hypothesis to be tested, often stating no difference or agreement with presumed population conditions. It is typically set up to be potentially disproven. It must contain an equality sign (e.g., =, ≥, or ≤).
- Alternative Hypothesis (HA): A statement of what is believed to be true if the null hypothesis is rejected. It usually aligns with the researcher's expectation.
- Rules for stating hypotheses:
- The researcher's desired conclusion should generally be in the alternative hypothesis.
- The null hypothesis must include a statement of equality.
- The null hypothesis is the one being directly tested.
- Null and alternative hypotheses are complementary, covering all possibilities for the parameter.
- Test statistic: A statistic computed from sample data that serves as a decision-maker.
- Distribution of test statistic: The probability distribution of the test statistic under the assumption that the null hypothesis is true. This is crucial for determining probabilities.
- Decision rule: Divides the possible values of the test statistic into two regions:
- Rejection region: Values less likely to occur if H0 is true, leading to rejection of H0.
- Nonrejection region: Values more likely to occur if H0 is true, leading to failure to reject H0.
- Significance Level (α): The probability of rejecting a true null hypothesis. Commonly used values are .01, .05, and .10. It defines the area of the rejection region.
- Type I Error: Rejecting a true null hypothesis (probability α).
- Type II Error: Failing to reject a false null hypothesis (probability β).
- Calculation of test statistic: Compute the value of the test statistic from the sample data.
- Statistical decision: Reject H0 if the computed test statistic falls in the rejection region; otherwise, do not reject H0.
- Conclusion: If H0 is rejected, conclude that HA is true. If H0 is not rejected, conclude that H0 may be true. It is important not to state that H0 is accepted.
- p-values: The probability that the computed test statistic is at least as extreme as the observed value, assuming the null hypothesis is true. A small p-value (typically ≤α) provides evidence against H0. The p-value is also the smallest α for which H0 can be rejected.
Note: Hypothesis testing does not prove a hypothesis; it only indicates whether the data support or do not support it. When a null hypothesis is not rejected, it simply means there isn't enough evidence to reject it; it doesn't confirm its truth. .
13.4 Purpose and considerations
The purpose of hypothesis testing is to aid in decision-making by providing a statistical basis. Administrative or clinical decisions typically align with the statistical decision. However, the statistical outcome is just one piece of evidence and should be considered alongside other relevant information.
Important: Procedures discussed often assume normally distributed data or rely on the Central Limit Theorem. For non-normal data or situations violating assumptions, non-parametric methods may be necessary. Variance equality is often assumed when comparing two samples. 238.
13.5 Hypothesis testing for a single population mean
This section details hypothesis testing for a population mean (μ) under various conditions, using a ten-step procedure.
13.6 Sampling from a normally distributed population with known variance
When the population is assumed to be normally distributed and its variance (σ2) is known, the z-test statistic is used.
- Test statistic: z=s/nxˉ−m0 where m0 is the hypothesized population mean 235.
- Distribution: Under H0, the test statistic follows a standard normal distribution.
Example 7.2.1: Two-sided test for a population mean
Researchers want to test if the mean age of a population is different from 30 years.
- Sample mean (xˉ) = 27
- Population variance (σ2) = 20
- Sample size (n) = 10
- Hypotheses: H0:μ=30 vs. HA:μ=30
- Significance level (α) = 0.05
- Test statistic calculation: z=20/1027−30=2−3=1.4142−3≈−2.12 .
- Decision rule: For a two-sided test with α=0.05, the critical values are ±1.96. Reject H0 if ∣z∣≥1.96.
- Statistical decision: Since ∣−2.12∣≥1.96, reject H0. The computed test statistic (-2.12) is in the rejection region. 242.
- Conclusion: Conclude that the population mean age is not equal to 30.
Testing with a Confidence Interval: The same conclusion can be reached by constructing a 95% confidence interval. If the hypothesized value is not within the interval, H0 is rejected. For Example 7.2.1, the 95% CI is (24.2286, 29.7714), which does not contain 30, supporting rejection of H0. 244 30.
One-sided hypothesis tests
If the research question focuses on whether the mean is greater than or less than a specific value, a one-sided test is appropriate. The entire rejection region is placed in one tail of the distribution.
Example 7.2.2: One-sided test for a population mean
Researchers want to test if the mean age of a population is less than 30 years.
- Hypotheses: H0:μ≥30 vs. HA:μ<30. The test is conducted at μ=30.
- Sample data and test statistic are the same as in Example 7.2.1: z≈−2.12.
- Decision rule: For a one-sided test with α=0.05 for HA:μ<30, the critical value is -1.645. Reject H0 if z≤−1.645. .
- Statistical decision: Since −2.12≤−1.645, reject H0.
- Conclusion: Conclude that the population mean age is less than 30.
- p-value: The p-value for this test is 0.0170, representing P(z≤−2.12) when H0 is true. 245.
If the question was "Can we conclude that the mean is greater than 30?", the rejection region would be in the upper tail with a critical value of +1.645.
13.7 Sampling from a normally distributed population with unknown variance
This is the more common scenario in practice. When the population variance is unknown, the t-distribution is used.
- Test statistic: t=s/nxˉ−m0 246.
- Distribution: When H0 is true, the test statistic follows Student's t-distribution with n−1 degrees of freedom.
Example 7.2.3: Two-sided t-test for a population mean
The study by Nakamura et al. collected data on the number of days between injury and initial MRI for patients with MCL and ACL tears. The goal is to test if the mean number of days is not 15 days.
- Data are provided in a table, indicating sample size (n) and sample standard deviation (s) would be calculated from these days.
- Hypotheses: H0:μ=15 vs. HA:μ=15.
The procedure would follow the same ten steps as outlined previously, but utilizing the t-distribution instead of the z-distribution for determining critical values and probabilities.
This section details the process of hypothesis testing for a single population mean, including considerations for sample size, population distribution, and the choice between z and t test statistics.
13.8 Hypothesis testing for a single population mean
Hypothesis testing provides a structured framework to determine if sample data offer sufficient evidence to reject a claim about a population parameter. The process involves defining hypotheses, selecting an appropriate test statistic, establishing a decision rule, and interpreting the results. The core steps are outlined below.
13.9 The ten-step hypothesis testing procedure
The standard procedure for hypothesis testing involves ten distinct steps, ensuring a rigorous and systematic approach to drawing conclusions from data.
- Data: Identify the data collected for the study.
- Assumptions: State the assumptions about the sample (e.g., simple random sample) and the population distribution (e.g., normality).
- Hypotheses: Formulate the null hypothesis (H0) and the alternative hypothesis (HA). H0 represents the status quo or no effect, while HA represents the claim to be tested.
- Test statistic: Choose the appropriate test statistic based on known or unknown population parameters and sample size.
- Distribution of test statistic: Specify the probability distribution of the test statistic if the null hypothesis is true.
- Decision rule: Define the rejection and non-rejection regions based on the chosen significance level (α) and the type of test (one-sided or two-sided).
- Calculation of test statistic: Compute the value of the test statistic using the sample data.
- Statistical decision: Compare the calculated test statistic to the critical value(s) and make a decision to reject or fail to reject H0.
- Conclusion: State the conclusion in the context of the problem, indicating whether there is sufficient evidence to support the alternative hypothesis.
- p-value: Determine the p-value, which is the probability of observing a test statistic as extreme as, or more extreme than, the one computed from the sample, assuming H0 is true.
Example: Testing if the mean number of days until MRI is not 15.
- Hypotheses: H0:μ=15, HA:μ=15.
- Test statistic: t-statistic, as population variance is unknown.
- Distribution: Student's t-distribution with n−1 degrees of freedom.
- Decision rule: For α=0.05 and a two-sided test, reject H0 if t≤−2.1199 or t≥2.1199 (with 16 degrees of freedom).
- Calculation: Sample mean = 13.2941, sample standard deviation = 8.88654, n=17. t=8.88654/1713.2941−15≈−0.791
- Decision: Do not reject H0 as −0.791 falls within the non-rejection region.
- Conclusion: The data do not provide sufficient evidence to conclude that the mean number of days is different from 15. The p-value is greater than 0.20. [ -248 247.
13.10 Handling non-normally distributed populations
When the population distribution is unknown or not normal, the Central Limit Theorem (CLT) becomes crucial for hypothesis testing about the population mean, provided the sample size is large (n≥30).
- Using the z-statistic with unknown population standard deviation: For large samples, the sample standard deviation (s) can be used as a reliable estimate of the population standard deviation (σ). The test statistic is then given by: z=s/nxˉ−μ0 When H0 is true, this statistic is approximately distributed as a standard normal distribution for large n. [ -249 248.
Example: Testing if mean systolic blood pressure is greater than 140 mm Hg for African-American men.
- Data: n=157, xˉ=146, s=27.
- Assumptions: Simple random sample, population not assumed to be normally distributed.
- Hypotheses: H0:μ≤140, HA:μ>140.
- Test statistic: z=(xˉ−μ0)/(s/n).
- Distribution: Approximately standard normal due to CLT.
- Decision rule: For α=0.05 and a one-sided test, reject H0 if z≥1.645.
- Calculation: z=27/157146−140≈2.78
- Decision: Reject H0 as 2.78>1.645.
- Conclusion: There is sufficient evidence to conclude that the mean systolic blood pressure for the population of African-American men is greater than 140 mm Hg. The p-value is 0.0027. [ -250 249.
13.11 Test statistics: z vs. t
The choice between using a z-test or a t-test for a single population mean depends on whether the population standard deviation (σ) is known or unknown.
| Scenario | Population Standard Deviation (σ) | Sample Size (n) | Test Statistic | Distribution |
|---|---|---|---|---|
| Known σ | Known | Any | z | Standard Normal (Z) |
| Unknown σ, Normal Population | Unknown | Small (<30) | t | Student's t (df=n−1) |
| Unknown σ, Non-normal Population | Unknown | Large (≥30) | z | Approx. Standard Normal (Z) |
| Unknown σ, Non-normal Population | Unknown | Small (<30) | Not applicable | (Consider non-parametric) |
Note: If the population standard deviation is unknown, but the population is normally distributed and the sample is small, the t-test is appropriate. If the population is not normally distributed and the sample is large, the z-test can be used due to the CLT, with the sample standard deviation (s) serving as an estimate for σ. [ ] 250.
13.12 Computer analysis in hypothesis testing
Statistical software packages greatly simplify the process of hypothesis testing, automating calculations for test statistics, p-values, and confidence intervals.
Example: Using Minitab to test H0:μ=34.5 against HA:μ=34.5 with sample data. The software calculates the t-statistic as approximately 4.31 and the p-value as 0.001. Since the p-value is less than the significance level α (typically 0.05), the null hypothesis is rejected. [ ].
When both z and t tests are inappropriate due to data characteristics or sample size, non-parametric techniques, such as the sign test (discussed in Chapter 13), may be employed for testing hypotheses about central tendency. [ ] 251.
14. Sampling distributions and hypothesis testing (part 7)
This section delves into hypothesis testing for the difference between two population means, building upon the foundational concepts of sampling distributions.
14.1 Hypothesis testing for the difference between two population means
Hypothesis testing concerning the difference between two population means is primarily used to determine if there is sufficient evidence to conclude that the means of two populations are unequal. The null hypothesis (H0) typically posits that the population means are equal or that their difference is zero, while the alternative hypothesis (HA) suggests they are not equal, or one is specifically greater or less than the other.
The approach to testing the difference between two population means varies based on assumptions about the populations and their variances:
14.2 Sampling from normally distributed populations with known population variances
When two independent simple random samples are drawn from normally distributed populations with known variances, a z-test statistic is employed.
-
Hypotheses:
- Two-sided: H0:μ1−μ2=0 versus HA:μ1−μ2=0
- One-sided (lower tail): H0:μ1−μ2≥0 versus HA:μ1−μ2<0
- One-sided (upper tail): H0:μ1−μ2≤0 versus HA:μ1−μ2>0
-
Test Statistic: z=n1σ12+n2σ22(xˉ1−xˉ2)−(μ1−μ2)0 where (μ1−μ2)0 is the hypothesized difference (typically 0). When H0 is true, this statistic follows a standard normal distribution.
-
Example: A study comparing serum uric acid levels between individuals with Down's syndrome and normal individuals with known population variances uses this z-test. If the calculated z-statistic falls outside the critical region defined by the significance level α, the null hypothesis is rejected, suggesting a difference in population means 255.
14.3 Sampling from normally distributed populations with unknown population variances
When population variances are unknown, there are two sub-cases: equal or unequal variances.
14.4 Equal population variances
If population variances are unknown but assumed to be equal, sample variances are pooled to estimate the common variance.
-
Pooled Variance: sp2=n1+n2−2(n1−1)s12+(n2−1)s22
t=sp2(n11+n21)(xˉ1−xˉ2)−(μ1−μ2)0 When H0 is true, this statistic follows a Student's t-distribution with n1+n2−2 degrees of freedom.
-
Example: Investigating wheelchair maneuvering pressure differences between spinal cord injury (SCI) subjects and healthy controls, where population variances are assumed equal but unknown, utilizes this t-test. If the computed t-statistic is outside the critical region, H0 is rejected 256-257.
14.5 Unequal population variances
When population variances are unknown and assumed to be unequal, a modified t-test is used without pooling variances.
$$ t_0 = \frac{(\bar{x}_1 - \bar{x}_2) - (\mu_1 - \mu_2)_0}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}} $$
The degrees of freedom for this test are not a simple integer and are approximated using a formula (Welch-Satterthwaite equation).
-
Critical Value Approximation: For a two-sided test, the critical value is approximately: t0,2α=w1+w2w1t1,2α+w2t2,2α where w1=s12/n1, w2=s22/n2, t1 and t2 are t-values from the t-distribution with n1−1 and n2−1 degrees of freedom, respectively.
-
Example: Comparing the aortic stiffness index between patients with hypertension and healthy controls, where population variances are unknown and unequal, employs this approach. A significant computed t-statistic leads to the rejection of the null hypothesis 258-259.
14.6 Sampling from populations that are not normally distributed
If populations are not normally distributed, but sample sizes are large (e.g., n≥30), the Central Limit Theorem can be applied. The distribution of the difference between sample means will be approximately normal.
$$ z = \frac{(\bar{x}_1 - \bar{x}_2) - (\mu_1 - \mu_2)_0}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}} $$
Here, sample variances are used as estimates for unknown population variances. Variances are not pooled. When $H_0$ is true, this statistic is approximately distributed as the standard normal distribution.
- Example: Examining IgG levels in subjects with and without thrombosis, where large sample sizes allow for the application of the z-test due to the Central Limit Theorem. If the computed z-statistic falls within the rejection region, the null hypothesis is rejected 260-261.
Note: Nonparametric techniques like the Mann-Whitney test or the median test can be used when the assumptions of normality are not met and sample sizes are not sufficiently large for the Central Limit Theorem to apply 262.
This section details the methodology and application of hypothesis testing for paired comparisons, focusing on situations where observations are dependent.
14.7 Paired comparisons tests
Paired comparisons tests are employed when observations are not independent, often due to the nature of the experimental design or data collection. This method is also known as a paired t-test when the differences between paired observations are normally distributed.
14.8 Reasons for pairing
Pairing observations is a strategy to control for extraneous sources of variation that could obscure or falsely indicate a true difference between groups. By pairing observations, researchers aim to make the pairs as similar as possible with respect to variables other than the one being tested, thus isolating the effect of the treatment or comparison.
- Controlling Extraneous Variation: When comparing two treatments (e.g., sunscreens), using independent samples might lead to confounding if one group naturally possesses characteristics (like darker skin tone) that affect the outcome (sun damage). Pairing ensures that both treatments are applied to subjects or units that are otherwise similar, allowing for a more direct comparison.
- Examples of Pairing:
- Measuring the same subjects before and after a treatment.
- Assigning litter mates or twins to different treatments.
- Dividing material for analysis between two methods.
- Matching individuals on a characteristic relevant to the outcome variable.
14.9 Hypothesis testing for paired differences
The core of a paired comparisons test involves analyzing the differences (di) between each pair of observations. The test statistic for hypotheses about the population mean difference (μd) assumes that the sample differences form a simple random sample from a normally distributed population of differences.
The test statistic is given by: t=sd/ndˉ−μd0 where:
- dˉ is the sample mean difference.
- μd0 is the hypothesized population mean difference.
- sd is the standard deviation of the sample differences.
- n is the number of sample differences (pairs).
When the null hypothesis is true, this test statistic follows a Student's t distribution with n−1 degrees of freedom. This is akin to a single-sample test because the analysis focuses on the distribution of the differences, effectively reducing the problem to a single variable.
Example 7.4.1: Gallbladder function before and after fundoplication
This example investigates whether fundoplication surgery increases gallbladder ejection fraction (GBEF). GBEF was measured in 12 patients before and after the surgery. The differences (di = postop GBEF - preop GBEF) were calculated.
- Data: GBEF measurements before and after surgery for 12 patients.
- Differences (di): 41.5, 28.2, -37.0, 28.6, 7.0, -30.4, 8.0, 18.8, 22.0, 36.2, 88.0, 6.0.
- Assumptions: The observed differences constitute a simple random sample from a normally distributed population of differences.
- Hypotheses:
- H0:μd=0 (Fundoplication does not change GBEF)
- HA:μd>0 (Fundoplication increases GBEF)
- Test Statistic: t=sd/ndˉ−μd0
- Distribution: Student's t with n−1=11 degrees of freedom.
- Decision Rule: For α=0.05, reject H0 if computed t≥1.7959.
- Calculation:
- Sample mean difference (dˉ): 18.075
- Sample standard deviation of differences (sd): 32.6817 (calculated from variance sd2=1068.0930)
- Computed t-value: 1.9159
- Statistical Decision: Reject H0 because 1.9159≥1.7959.
- Conclusion: Sufficient evidence exists to conclude that fundoplication increases GBEF functioning.
- p-value: 0.041.
14.10 Using the z-test for paired data
If the population variance of the differences (σd2) is known, a z-test can be used. The test statistic is: z=σd/ndˉ−μd0 However, in practice, the population variance is rarely known. If the assumption of normally distributed differences cannot be met and n is large, the Central Limit Theorem allows the use of the z-statistic, with sd used as an estimate for σd.
14.11 Disadvantages and alternatives
Using paired comparisons, while beneficial for controlling extraneous variation, has drawbacks:
- Matching Effort: Matching individuals can be time-consuming and expensive.
- Loss of Degrees of Freedom: A paired test with n pairs has n−1 degrees of freedom, whereas an independent samples test with 2n observations would have 2n−2 degrees of freedom.
If a t-test or z-test is not appropriate (e.g., due to non-normality and small sample size), nonparametric alternatives, such as the sign test, can be considered to test hypotheses about a median difference.
15. Sampling distributions and hypothesis testing (part 8)
This section delves into hypothesis testing for population proportions and variances, building upon the foundational concepts of sampling distributions.
15.1 Hypothesis testing for a single population proportion
Hypothesis testing for a population proportion (p) follows a similar structure to testing for a population mean, provided the conditions for using the normal curve approximation are met. These conditions typically involve a sufficiently large sample size, allowing for the application of the central limit theorem.
-
Test Statistic: When the sample size is large enough, the test statistic for a population proportion is calculated as: z=np0(1−p0)p^−p0 where:
- p^ is the sample proportion.
- p0 is the hypothesized population proportion under the null hypothesis.
- n is the sample size.
-
Distribution of Test Statistic: If the null hypothesis (H0) is true, this test statistic is approximately distributed as a standard normal variable.
-
Hypotheses: The hypotheses are formulated in terms of population proportions:
- H0:p=p0
- HA:p>p0 (one-sided, upper tail)
- HA:p<p0 (one-sided, lower tail)
- HA:p=p0 (two-sided)
-
Standard Error Calculation: When H0 is true (p=p0), the standard error is calculated using the hypothesized proportion p0, not the sample proportion p^, to maintain consistency with the assumption that the null hypothesis is true. sp^=np0(1−p0)
Example: Testing for a higher prevalence of impaired fasting glucose (IFG) in a specific population. If a sample of 301 women has 24 with IFG (p^=0.080) and the hypothesized population prevalence is 6.3 percent (p0=0.063), we would test H0:p=0.063 against HA:p>0.063 with α=0.05. The calculated z-value of 1.21 would lead to not rejecting H0, indicating insufficient evidence to conclude a higher prevalence 276.
- Computer Outputs: Statistical software packages like MINITAB and NCSS can perform these tests, often providing test statistics, p-values, and confidence intervals. Note that minor variations in results may occur due to rounding or the use of continuity corrections 277.
15.2 Hypothesis testing for the difference between two population proportions
This section focuses on comparing two population proportions (p1 and p2). A common hypothesis is that the difference between these proportions is zero.
-
Pooled Estimate: When the null hypothesis is p1=p2, we can combine the samples to estimate a common proportion. This pooled proportion is calculated as: p^=n1+n2x1+x2 where x1 and x2 are the number of successes in sample 1 and sample 2, respectively, and n1 and n2 are the respective sample sizes. The pooled estimate for q is q^=1−p^.
-
Estimated Standard Error: The estimated standard error of the difference between two sample proportions, assuming H0 is true and using the pooled estimate, is: s^p^1−p^2=p^(1−p^)(n11+n21)
-
Test Statistic: The test statistic for the difference between two proportions is: z=s^p^1−p^2p^1−p^2 Alternatively, if not pooling, the standard error would be calculated as n1p^1(1−p^1)+n2p^2(1−p^2).
-
Distribution of Test Statistic: If the null hypothesis is true, the test statistic z is approximately distributed as a standard normal variable.
-
Hypotheses:
- H0:p1−p2=0 (or p1=p2)
- HA:p1−p2>0 (or p1>p2)
- HA:p1−p2<0 (or p1<p2)
- HA:p1−p2=0 (or p1=p2)
Example: Comparing the proportion of males and females with Noonan syndrome falling below the third percentile of adult height. If 11 out of 29 males (p^M=0.379) and 24 out of 44 females (p^F=0.545) fall below the percentile, and we test H0:pF=pM against HA:pF>pM with α=0.05. Using a pooled estimate (p^=0.479), the calculated z-value is 1.39. Since 1.39 is not greater than the critical value of 1.645, we fail to reject H0, suggesting no significant difference in proportions [279-280]
- Computer Outputs: Similar to single proportion tests, statistical software can be used to analyze the difference between two proportions 281.
15.3 Hypothesis testing for a single population variance
This section covers testing hypotheses about a population variance (σ2). This test requires the assumption that the population from which the sample is drawn is normally distributed.
-
Test Statistic: The test statistic for a population variance is: χ2=σ02(n−1)s2
- s2 is the sample variance.
- σ02 is the hypothesized population variance under the null hypothesis.
-
Distribution of Test Statistic: If the null hypothesis is true and the population is normally distributed, the test statistic follows a chi-square distribution with n−1 degrees of freedom.
- H0:σ2=σ02
- HA:σ2=σ02 (two-sided)
- HA:σ2>σ02 (one-sided, upper tail)
- HA:σ2<σ02 (one-sided, lower tail)
Example: Investigating the variance of insulin-like growth factor (IGF-I) levels in children with burns. If a sample of 16 children yielded a sample variance (s2) of 670.81, and we want to test if the population variance is not 600 (σ02=600), we would test H0:σ2=600 against HA:σ2=600 with α=0.05. The calculated χ2 statistic is 16.77. With 15 degrees of freedom, the critical values are 6.262 and 27.488. Since 16.77 falls between these values, we do not reject H0, meaning we cannot conclude the population variance is different from 600 283.
- p-value Determination: Determining the p-value for a two-sided chi-square test requires careful consideration of the asymmetric distribution. It is often reported as p>α for two-sided tests when the calculated statistic falls within the non-rejection region 284.
15.4 Hypothesis testing for the ratio of two population variances
This section introduces the F-test for comparing two population variances, which is crucial for assumptions in t-tests for the difference between means.
-
Test Statistic (Variance Ratio): The test statistic, denoted as V.R., is the ratio of the two sample variances. For a two-sided test, the larger sample variance is placed in the numerator to ensure the test statistic is ≥1. V.R.=s22s12 where s12 is the larger sample variance and s22 is the smaller sample variance for a two-sided test. For a one-sided test, the order is determined by the hypothesis.
-
Distribution of Test Statistic: If the null hypothesis of equal population variances is true and the populations are normally distributed, the variance ratio follows an F-distribution with n1−1 numerator degrees of freedom and n2−1 denominator degrees of freedom.
- H0:σ12=σ22 (or σ22σ12=1)
- HA:σ12=σ22 (two-sided)
- HA:σ12>σ22 (one-sided)
- HA:σ12<σ22 (one-sided)
Example: Comparing the variability in load at failure for two meniscal repair techniques (FasT-FIX vs. vertical suture). If the standard deviation for FasT-FIX (group 1) is 30.62 (s12=937.5844) and for the vertical suture (group 2) is 11.37 (s22=129.2769), and we test H0:σ12=σ22 against HA:σ12>σ22 with α=0.05. The computed V.R. is 7.25. With 5 numerator and 5 denominator degrees of freedom, the critical F-value is 5.05. Since 7.25 > 5.05, we reject H0, concluding that the variance of load at failure is higher for the FasT-FIX method [286-287]
- Decision Rule: Reject H0 if the computed V.R. is greater than or equal to the critical F-value for the specified alpha level and degrees of freedom.
This section delves into the critical concepts of hypothesis testing, focusing on the Type II error, the power of a test, and how to calculate and interpret these crucial elements.
15.5 Understanding Type II errors and the power of a test
Hypothesis testing involves two types of errors: Type I (rejecting a true null hypothesis) and Type II (failing to reject a false null hypothesis). While Type I error (α) is a single, pre-determined value set by the investigator, Type II error (β) can vary and depends on several factors: the true value of the parameter, the hypothesized value, the significance level (α), and the sample size (n).
Note: The probability of committing a Type II error (β) is not fixed for a given test. It changes based on how far the true parameter value is from the value specified in the null hypothesis.
The power of a test, denoted as 1−β, quantifies the probability of correctly rejecting a false null hypothesis. This is a crucial measure of a test's effectiveness in detecting a true effect. For any given alternative value of the parameter, the power can be computed. A power function graphically represents the power of a test across various alternative parameter values, often visualized as a power curve.
Important: A higher power indicates a greater ability of the test to detect a false null hypothesis.
15.6 Calculating Type II error and power
To calculate β and 1−β, one must define the rejection and non-rejection regions based on the null hypothesis and the chosen significance level (α). Subsequently, the calculations are performed using the sampling distribution under a specific alternative hypothesis.
Consider a hypothesis test for a population mean (μ): H0:μ=μ0 HA:μ=μ0
When a simple random sample of size n is drawn from a population with a known or estimated standard deviation (σ), the sampling distribution of the sample mean (xˉ) under the null hypothesis is approximately normal with mean μ0. The critical values for the rejection region are determined using α and the standard error of the mean (σ/n).
xˉU=μ0+zα/2nσ xˉL=μ0−zα/2nσ
If the null hypothesis is false, the true population mean is μ1=μ0. The sampling distribution of xˉ under this true mean is also approximately normal, but with mean μ1. The probability of a Type II error (β) is the area under this alternative sampling distribution that falls within the non-rejection region defined by H0.
Mathematically, β is the probability of observing a sample mean within the non-rejection region when the true mean is μ1:
β=P(xˉL≤xˉ≤xˉU∣true mean is μ1)
This probability can be found by standardizing xˉL and xˉU using the mean μ1 and standard error σ/n:
β=P(σ/nxˉL−μ1≤z≤σ/nxˉU−μ1)
The power of the test for the alternative μ1 is then 1−β.
Remember: As the true parameter value (μ1) moves further away from the hypothesized value (μ0), the probability of committing a Type II error (β) decreases, and consequently, the power (1−β) increases.
Figure 7.9.1 and Table 7.9.1 from the source material illustrate how β and the power change for different alternative values of the population mean (μ). When μ is closer to μ0, β is higher and power is lower. Conversely, when μ is further from μ0, β is lower and power is higher.
16. Sampling distributions and hypothesis testing (part 9)
This section concludes the discussion on hypothesis testing by elaborating on power curves, operating characteristic curves, and the determination of sample size to control both Type I and Type II errors, as well as providing a comprehensive summary of formulas and review questions.
16.1 Understanding Type II Errors and Test Power
The probability of a Type II error, denoted by b, represents the likelihood of failing to reject a false null hypothesis (H0). The power of a test is defined as 1−b, indicating the probability of correctly rejecting a false null hypothesis.
- Power Curve: A power curve graphically illustrates the power of a test for various possible values of the parameter under the alternative hypothesis (HA).
- For a two-sided test, the power curve typically has a V-shaped appearance. A narrower V indicates better discrimination between the null and alternative hypotheses, while a wider V suggests poorer discrimination.
- For a one-sided test with the rejection region in the upper tail, the power curve resembles an elongated S. If the rejection region is in the lower tail, it takes the form of a reverse elongated S.
- Operating Characteristic (OC) Curve: An OC curve is the complement of a power curve, plotting the values of b (the probability of a Type II error) on the vertical axis.
Note: A decision based on rejecting the null hypothesis is generally more conclusive than one based on failing to reject it, because the probability of being wrong (Type I error, a) is typically smaller than the probability of being wrong when failing to reject a false null hypothesis (Type II error, b) 293.
16.1.1 Example: Power Curve for a One-Sided Test
Consider a scenario where the null hypothesis is H0:μ≥65 seconds, and the alternative hypothesis is HA:μ<65 seconds, with a significance level a=0.01 and a sample size n=20. The population standard deviation is s=15 seconds. To construct the power curve, b is calculated for various alternative values of μ. For instance, if the true mean is μ=55 seconds, the critical value for xˉ is calculated, and then b is determined as the probability of observing a sample mean greater than this critical value, given μ=55. This process is repeated for other values of μ to generate the power curve 294.
16.2 Determining Sample Size to Control Type II Errors
When designing a study, it is often desirable to control both the Type I error rate (a) and the Type II error rate (b). This involves determining an appropriate sample size (n) that simultaneously satisfies desired levels for both error probabilities.
The process involves establishing the critical value (C) for the test statistic. This critical value is expressed in terms of the population mean under the null hypothesis (m0) and a corresponding z-score (z0) related to a, as well as in terms of the population mean under a specific alternative hypothesis (m1) and a z-score (z1) related to b.
The relationship can be expressed as: C=m0−z0nsandC=m1+z1ns (Note: The signs of z0 and z1 depend on the direction of the one-sided test.)
By setting these two expressions for C equal to each other, we can solve for the required sample size n: n=(m0−m1z0s+z1s)2=(m0−m1)2(z0+z1)2s2 296-297
Important: When calculating n, both z0 and z1 are typically taken as positive values, and their signs are adjusted based on the critical value's position relative to m0 and m1 in the respective sampling distributions.
After determining n, the critical value C can be calculated using either of the original equations. This allows for the formulation of a decision rule that controls both a and b.
16.2.1 Example: Sample Size Calculation
For a test with H0:μ≥65, HA:μ<65, s=15, a=0.01, and a desired b=0.05 when μ=55:
- m0=65, m1=55.
- From standard normal tables, z0≈2.33 (for a=0.01 in the lower tail) and z1≈1.645 (for b=0.05 in the upper tail).
- Using the formula: n=(65−55)2(2.33+1.645)2×152=102(3.975)2×225=10015.800625×225≈35.55
- Therefore, a sample size of n=36 is required.
- The critical value C can then be calculated as approximately 59.175 dollars 297.
16.3 Summary of Formulas and Concepts
This chapter provided a comprehensive overview of hypothesis testing, outlining a ten-step procedure and detailing specific tests for various parameters.
General Hypothesis Testing Procedure:
- Description of data.
- Statement of necessary assumptions.
- Statement of null and alternative hypotheses.
- Specification of the test statistic.
- Specification of the distribution of the test statistic.
- Statement of the decision rule.
- Calculation of test statistic from sample data.
- The statistical decision based on sample results.
- Conclusion.
- Determination of p-value 298.
Key Formulas:
| Formula Number | Name | Formula |
|---|---|---|
| 7.1.1, 7.1.2 | z-transformation (single mean) | z=s/nxˉ−μ0 |
| 7.2.2 | t-transformation (single mean, σ unknown) | t=s/nxˉ−μ0 |
| 7.3.1 | z-statistic (difference between two means, σ1,σ2 known) | z=n1s12+n2s22(xˉ1−xˉ2)−(μ1−μ2) |
| 7.3.2 | t-statistic (difference between two means, σ1,σ2 unknown, equal variances) | t=sp2(n11+n21)(xˉ1−xˉ2)−(μ1−μ2), where sp2=n1+n2−2(n1−1)s12+(n2−1)s22 |
| 7.3.3, 7.3.4 | t-statistic (difference between two means, σ1,σ2 unknown, unequal variances) | t0=n1s12+n2s22(xˉ1−xˉ2)−(μ1−μ2) |
| 7.5.1 | z-statistic (single proportion) | z=np0q0p^−p0 |
| 7.6.1, 7.6.2 | z-statistic (difference between two proportions) | z=s^p^1−p^22(p^1−p^2)−(p1−p2), where p^=n1+n2x1+x2 and s^p^1−p^22=p^(1−p^)(n11+n21) |
| 7.7.1 | χ2-statistic (single variance) | χ2=σ02(n−1)s2 |
| 7.8.1 | Variance ratio (F-statistic) | F=s22s12 |
| 7.9.1, 7.9.2 | Critical values for xˉ | xˉU=μ0+zns, xˉL=μ0−zns |
| 7.10.1, 7.10.2 | Critical value for determining sample size (C) | C=m0−z0ns=m1+z1ns |
| 7.10.3 | Sample size to control Type II errors (n) | n=(m0−m1)2(z0+z1)2s2 |
Symbol Key:
- a: Type I error rate
- C: Critical value
- χ2: Chi-square distribution
- dˉ: Average difference
- μ: Mean of population
- μ0: Hypothesized mean
- n: Sample size
- p: Proportion for population
- pˉ: Average proportion
- q: 1−p
- p^: Estimated proportion for sample
- s2: Population variance
- s: Population standard deviation
- sˉxˉ: Standard error of the mean
- sˉd: Standard deviation of the difference
- sp: Pooled standard deviation
- t: Student's t-transformation
- t0: Cochran's correction to t
- xˉ: Mean of sample
- xˉL: Lower limit of critical value for xˉ
- xˉU: Upper limit of critical value for xˉ
- z: Standard normal transformation
16.4 Review Questions
- What is the fundamental purpose of hypothesis testing?
- Define Type I error, Type II error, the power of a test, the power function, the power curve, and the operating characteristic curve.
- Explain the differences in power curves for one-sided versus two-sided tests.
- What are the underlying assumptions for using the t statistic for a single mean and for the difference between two means?
- When is the z-statistic appropriate for testing hypotheses concerning: a single mean, the difference between two means, a single proportion, and the difference between two proportions?
- Discuss the rationale behind pooling sample variances and the rationale for using paired comparisons tests.
- Provide practical examples from your field of interest where various hypothesis tests (single mean, difference between means, single proportion, difference between proportions, variance, ratio of variances) would be appropriate. 301-303
17. Analysis of variance and regression analysis (part 1)
This section introduces fundamental statistical techniques for analyzing data, focusing on comparing means across multiple groups (Analysis of Variance) and modeling relationships between variables (Regression Analysis).
17.1 Introduction to analysis of variance and regression
Analysis of variance (ANOVA) and regression analysis are powerful statistical methodologies used to understand and model relationships within data. ANOVA is primarily employed to compare means of two or more groups, while regression analysis aims to quantify the relationship between a dependent variable and one or more independent variables, allowing for prediction and inference about these relationships.
17.2 Fundamentals of analysis of variance (ANOVA)
Analysis of variance is a statistical method that partitions the total variation in a dataset into components attributable to different sources of variation. The core idea is to compare the variance between groups to the variance within groups to determine if there are statistically significant differences among the group means.
17.3 Completely randomized design
A completely randomized design (CRD) is the simplest experimental design where experimental units are assigned to treatment groups randomly. This ensures that each unit has an equal chance of receiving any particular treatment.
Note: In a CRD, the assignment of subjects or units to treatment groups is completely random, without any stratification or blocking. This helps to minimize bias and allows for the most straightforward application of ANOVA. [304-317
17.4 Randomized complete block design
A randomized complete block design (RCBD) is used when there is a known source of variability (a blocking factor) that can influence the outcome. Experimental units are first grouped into blocks based on this factor, and then treatments are randomly assigned within each block. This design helps to control for the variability introduced by the blocking factor, making it easier to detect treatment effects.
Example: If studying the effect of different fertilizers on plant growth, and soil type is known to affect growth, plants could be blocked by soil type, and then different fertilizers randomly assigned within each soil type block. [304-317
17.5 Repeated measures design
A repeated measures design involves measuring the same subjects or units multiple times under different conditions or at different time points. This design is useful for studying changes over time or the effects of treatments within the same individuals, reducing variability that arises from individual differences.
Important: In a repeated measures design, the same subjects are used for all treatments or measurements. This requires specific statistical approaches (like paired t-tests for two conditions or more complex ANOVA for multiple conditions) to account for the correlation between measurements from the same subject. [304-317
17.6 Factorial experiments
Factorial experiments involve investigating the effects of two or more factors simultaneously. This design allows researchers to examine not only the main effects of each factor but also any interaction effects between them, where the effect of one factor depends on the level of another factor.
17.7 Introduction to regression analysis
Regression analysis is a set of statistical processes for estimating the relationships between a dependent variable (often called the outcome or response variable) and one or more independent variables (often called predictors, covariates, or features). Regression aims to find a mathematical equation that best describes the observed data.
17.8 Simple linear regression
Simple linear regression models the relationship between a single dependent variable and a single independent variable using a straight line. The goal is to find the line that best fits the data by minimizing the sum of squared differences between the observed and predicted values of the dependent variable.
The model is represented by the equation: Y=β0+β1X+ϵ where:
- Y is the dependent variable.
- X is the independent variable.
- β0 is the y-intercept.
- β1 is the slope of the line, representing the change in Y for a one-unit change in X.
- ϵ is the error term, representing the variation in Y not explained by X. [304-317
17.9 Multiple linear regression
Multiple linear regression extends simple linear regression to model the relationship between a dependent variable and two or more independent variables. This allows for a more comprehensive understanding of how multiple factors contribute to the outcome.
Y=β0+β1X1+β2X2+⋯+βkXk+ϵ
- X1,X2,…,Xk are the independent variables.
- β1,β2,…,βk are the regression coefficients, each representing the change in Y for a one-unit change in the corresponding Xi, holding all other independent variables constant.
- ϵ is the error term. [304-317
17.10 Correlation
Correlation measures the strength and direction of the linear relationship between two quantitative variables. The correlation coefficient, denoted by r, ranges from -1 to +1. A value of +1 indicates a perfect positive linear relationship, -1 indicates a perfect negative linear relationship, and 0 indicates no linear relationship. Correlation does not imply causation. [304-317
17.11 Logistic regression
Logistic regression is used when the dependent variable is binary (i.e., it has only two possible outcomes, such as yes/no, success/failure). It models the probability of the outcome occurring as a function of one or more independent variables. The logistic function (logit) is typically used to map the linear combination of predictors to a probability between 0 and 1. [304-317
Tip: While correlation quantifies linear association, it does not establish causality. Regression analysis helps in building predictive models and understanding how independent variables influence a dependent variable, but careful interpretation is needed to avoid inferring causation without appropriate study design. [304-317
This section introduces the fundamental concepts of analysis of variance (ANOVA) and linear regression as powerful tools for analyzing relationships between variables and partitioning variance in data.
17.12 Introduction to linear models and their application
Linear models provide a mathematical framework for representing relationships between variables, where an outcome variable (y) is modeled as a function of one or more explanatory variables (x). The primary goal is to understand how much of the variability in the outcome variable can be attributed to these explanatory variables.
17.13 Defining key terms
- Outcome variable: This is the variable whose measured values result from an experiment or statistical process. It is often denoted by y.
- Explanatory variable: This is a variable that is useful for predicting the value of the outcome variable. It is often denoted by x.
17.14 The general form of a linear model
A linear model is characterized by its linearity in the parameters. The generic form of a linear model is:
Yj=β0+β1X1j+β2X2j+⋯+βkXkj+ϵj(8.1.1)
- Yj is the j-th observation of the outcome variable.
- β0,β1,…,βk are the model parameters (coefficients).
- X1j,X2j,…,Xkj are the j-th observations of the k explanatory variables.
- ϵj represents the random error associated with the j-th observation.
Note: Any model that can be expressed in this form, where the coefficients are constants and the algebraic order is one, is considered a linear model. These models are generally solvable using basic algebra or calculus.
17.15 Applications of linear models
Linear models are foundational for several statistical techniques:
- Analysis of Variance (ANOVA): Used for testing differences among means, particularly when dealing with more than two populations or variables. In ANOVA, predictor variables are typically classification variables that define factors of interest (e.g., treatment groups).
- Regression Analysis: Employed for making predictions of an outcome variable based on one or more predictor variables. Predictor variables in regression are most often continuous.
- Correlation: Used for understanding associations among variables.
While these applications may seem distinct, they share the underlying principles of linear modeling.
Important: This section marks the beginning of exploring linear models, which are central to understanding both analysis of variance and regression. The subsequent sections will detail the specific designs and methodologies within ANOVA and then transition to regression techniques 323.
18. Analysis of variance and regression analysis (part 2)
This section focuses on the principles and applications of Analysis of Variance (ANOVA) for comparing multiple means, specifically within the framework of experimental designs like the completely randomized design, and introduces the fundamental concepts of regression analysis.
18.1 Introduction to analysis of variance
Analysis of variance (ANOVA) is a statistical technique used to partition the total variation in a dataset into components attributable to different sources. Developed significantly by R. A. Fisher, ANOVA is widely applied in experimental data analysis to test hypotheses about population means. While ANOVA can be used to estimate and test hypotheses about population variances, this section focuses on its application for comparing population means, particularly when there are three or more groups. The core idea is to determine if observed differences among sample means are statistically significant or likely due to random chance 324.
Key Concepts:
- Treatment Variable: The variable whose "values" (treatments) are being compared.
- Response Variable: The variable measured to assess the effect of the treatment variable.
- Extraneous Variables: Variables that could affect the response variable but are not the primary focus of the experiment.
ANOVA relies on several underlying assumptions for valid statistical inference. These assumptions are crucial, and deviations from them can lead to approximate rather than exact results. The techniques discussed will be applied to specific experimental designs, including the completely randomized design, randomized complete block design, and factorial experiments. The general ten-step procedure for hypothesis testing in ANOVA is outlined, with particular emphasis on the calculation of the test statistic and its summarization in an ANOVA table 325.
The complexity of ANOVA calculations often necessitates the use of computers and statistical software packages for practical analysis.
18.2 The completely randomized design
The completely randomized design is the simplest type of ANOVA, used when investigating a single source of variation or factor, and it serves as an extension of the t-test for comparing three or more independent samples. This design is employed when treatments are assigned completely at random to experimental units.
18.3 Rationale and random allocation
When comparing multiple population means, attempting to conduct all possible pairwise t-tests becomes computationally intensive and, more critically, inflates the Type I error rate. ANOVA provides a more efficient and controlled method for testing the null hypothesis that multiple population means are equal. In a completely randomized design, subjects or experimental units are randomly allocated to different treatments 326.
Example of Random Allocation: If 16 subjects are available to compare four drugs (A, B, C, D), subjects are numbered 01-16. Random numbers are used to assign subjects to each drug group. The number of subjects per group does not need to be equal 327.
18.4 Hypothesis testing steps
The hypothesis testing procedure for a completely randomized design follows a structured ten-step process:
-
Description of data: Sample data, including means and totals for each treatment group, are presented, typically in a table.
- xij: The i-th observation from the j-th treatment.
- T:j=∑i=1njxij: Total of the j-th treatment.
- xˉ:j=T:j/nj: Mean of the j-th treatment.
- T::=∑j=1kT:j=∑j=1k∑i=1njxij: Total of all observations.
- xˉ::=T::/N: Grand mean of all observations, where N=∑j=1knj is the total number of observations 328.
-
Assumptions: The model and assumptions for the fixed-effects model are stated.
- The Model: xij=μ+τj+ϵij, where:
- μ is the grand mean.
- τj is the treatment effect (difference between the j-th population mean and the grand mean).
- ϵij is the error term (deviation of an individual measurement from its population mean).
- Assumptions for Fixed-Effects Model:
- The k sets of observed data are independent random samples.
- Each population is normally distributed with mean μj and variance σj2.
- All populations have the same variance (σ12=σ22=⋯=σk2=σ2).
- The τj are unknown constants with ∑j=1kτj=0.
- The ϵij have a mean of 0.
- The ϵij have a variance of σ2 (the common population variance).
- The ϵij are normally and independently distributed 329.
- The Model: xij=μ+τj+ϵij, where:
-
Hypotheses:
- H0:μ1=μ2=⋯=μk (All population means are equal).
- HA: Not all μj are equal.
- Alternatively, in terms of treatment effects:
- H0:τj=0 for all j=1,…,k.
- HA: Not all τj are 0.
If H0 is true and assumptions are met, populations will be centered at the same point. If H0 is false, population means may differ 330.
-
Test statistic: The test statistic is a variance ratio, V.R., which compares two estimates of the common population variance, σ2.
-
Distribution of test statistic: When H0 is true and assumptions are met, V.R. follows an F-distribution.
-
Decision rule: Reject H0 if the computed V.R. is greater than or equal to the critical value of F for the chosen significance level (α).
-
Calculation of test statistic: This involves partitioning the total variation (Total Sum of Squares, SST) into components:
- Total Sum of Squares (SST): Measures the total variation in the data. SST=∑j=1k∑i=1nj(xij−xˉ::)2.
- Within Groups Sum of Squares (SSW): Measures the variation within each treatment group. This is also known as the residual or error sum of squares. SSW=∑j=1k∑i=1nj(xij−xˉ:j)2 331.
- Among Groups Sum of Squares (SSA): Measures the variation among the group means. SSA=∑j=1knj(xˉ:j−xˉ::)2.
- The relationship SST=SSA+SSW holds.
Two estimates of the common population variance, σ2, are derived:
- Within Groups Mean Square (MSW): An unbiased estimate of σ2, calculated from SSW divided by its degrees of freedom (N−k). MSW=N−kSSW 332. MSW is a valid estimate of σ2 regardless of whether H0 is true, as long as population variances are equal.
- Among Groups Mean Square (MSA): An estimate of σ2 derived from SSA divided by its degrees of freedom (k−1). MSA=k−1SSA 333. MSA is a valid estimate of σ2 only if H0 is true and population variances are equal.
The Variance Ratio (test statistic) is the ratio of MSA to MSW: V.R.=F=MSWMSA If H0 is true, MSA and MSW should be similar, resulting in F≈1. If H0 is false, MSA is expected to be larger than MSW, leading to F>1 334.
The F-distribution is characterized by its numerator degrees of freedom (k−1) and denominator degrees of freedom (N−k) 335.
The ANOVA Table summarizes these calculations:
-
Statistical decision: Compare the computed F-statistic (V.R.) with the critical F-value from the F-distribution table. Reject H0 if V.R.≥Fcritical.
-
Conclusion:
- If H0 is rejected, conclude that not all population means are equal.
- If H0 is not rejected, conclude that there is no statistically significant difference among the population means.
-
Determination of p-value: The p-value is the probability of observing an F-statistic as extreme as, or more extreme than, the computed value, assuming H0 is true.
Example 8.2.1: Selenium Content in Meats This example applies the completely randomized design to compare the selenium content of four types of meat: venison (VEN), squirrel (SQU), region-raised beef (RRB), and nonregion-raised beef (NRB). The study assumes independent random samples from normally distributed populations with equal variances. The selenium content is measured in milligrams per 100 grams of dry weight. Calculations would proceed to construct an ANOVA table and determine if there are significant differences in selenium levels among the four meat types [336-337]
This section explores the application of analysis of variance (ANOVA) for comparing multiple group means using the completely randomized design and details methods for post-hoc analysis of significant differences between individual means.
18.5 The completely randomized design (CRD)
The completely randomized design (CRD) is a fundamental experimental design used when experimental units are homogeneous and can be randomly assigned to treatments. It is applied when the goal is to compare the means of several groups or treatments.
Note: The CRD is appropriate only when the experimental units are homogeneous. If there is significant heterogeneity, alternative designs like randomized block or repeated measures designs should be considered.
The general procedure for conducting a one-way ANOVA in a CRD involves the following steps:
-
Hypotheses:
- Null Hypothesis (H0): All population means are equal (μ1=μ2=⋯=μk), where k is the number of treatments.
- Alternative Hypothesis (HA): At least one population mean is different from the others.
-
Test Statistic: The test statistic used is the F-statistic, calculated as the ratio of the mean square among treatments (MSA) to the mean square within treatments (MSW): F=MSWMSA
-
Distribution of Test Statistic: Under the null hypothesis and assuming the ANOVA assumptions are met, the F-statistic follows an F-distribution with (k−1) numerator degrees of freedom and (N−k) denominator degrees of freedom, where N is the total number of observations.
-
Decision Rule: Based on a chosen significance level (α), a critical F-value is determined from the F-distribution table. The null hypothesis is rejected if the computed F-statistic is greater than or equal to the critical value.
-
Calculation: Sums of squares (SST, SSA, SSW) are calculated to determine MSA and MSW. These are typically presented in an ANOVA table.
- SST (Total Sum of Squares): Measures the total variability in the data.
- SSA (Sum of Squares Among Treatments): Measures the variability between the sample means.
- SSW (Sum of Squares Within Treatments / Error): Measures the variability within each treatment group. SST=∑i=1k∑j=1ni(yij−yˉˉ)2 SSA=∑i=1kni(yˉi−yˉˉ)2 SSW=∑i=1k∑j=1ni(yij−yˉi)2=SST−SSA where yij is the j-th observation in the i-th treatment, yˉi is the mean of the i-th treatment, yˉˉ is the overall mean, ni is the number of observations in the i-th treatment, and k is the number of treatments.
The mean squares are calculated as: MSA=k−1SSA MSW=N−kSSW
-
Statistical Decision: The computed F-statistic is compared to the critical F-value. If Fcomputed≥Fcritical, H0 is rejected.
-
Conclusion: A conclusion is drawn about the equality of population means based on the statistical decision.
Example: In an experiment comparing the selenium content of four different meat types (NRB, RRB, SQU, VEN), a CRD was used. The ANOVA table showed a computed F-statistic of 27.00. With a significance level of α=0.01, the critical F-value was 3.95. Since 27.00 > 3.95, the null hypothesis of equal mean selenium content was rejected, concluding that at least one meat type has a different average selenium content 338.
18.6 Computer Analysis of CRD
Statistical software packages significantly simplify the analysis of CRD. Programs like MINITAB and SAS automate the calculations and provide comprehensive output, including ANOVA tables, means, standard deviations, and confidence intervals.
- MINITAB Output: Typically labels "factor" for "among samples" and "levels" for treatments. It provides individual 95% confidence intervals for each group mean and the pooled standard deviation (the square root of the error mean square) 339.
- SAS Output: Includes additional metrics like R-Square (proportion of total variability explained by treatments) and Coefficient of Variation (CV). R-Square is calculated as SSA/SST. The test statistic is labeled as "F Value.".
Important: Different software may use varying labels for the test statistic (e.g., F vs. F Value vs. V.R.) and ANOVA components.
Tip: Side-by-side boxplots are a useful graphical tool to visually compare the distributions and central tendencies of data across different treatment groups in a CRD.
18.7 Alternatives to CRD
If the assumptions of the one-way ANOVA (e.g., normality of residuals, homogeneity of variances) are not met, non-parametric alternatives such as the Kruskal-Wallis test can be considered 340.
18.8 Testing for significant differences between individual pairs of means
When the overall ANOVA test rejects the null hypothesis (H0) of no difference among population means, it indicates that at least one mean is different, but it doesn't specify which pairs of means differ. Post-hoc tests, also known as multiple comparison procedures, are used to identify these specific differences.
Caution: Performing numerous pairwise comparisons increases the probability of making a Type I error (falsely rejecting a true null hypothesis). Therefore, a controlled procedure is necessary to maintain an overall significance level.
Commonly used multiple comparison procedures include Tukey's HSD test and Bonferroni's method.
18.9 Tukey's Honestly Significant Difference (HSD) Test
Tukey's HSD test is a widely used procedure for testing all possible pairs of treatment means when the sample sizes are equal. It controls the family-wise error rate at a chosen significance level (α).
-
HSD Calculation (Equal Sample Sizes): HSD=qα,k,N−knMSE where:
- qα,k,N−k is the studentized range statistic, obtained from Appendix Table H for the given α, number of means (k), and degrees of freedom (N−k) 341.
- MSE is the error mean square from the ANOVA table.
- n is the number of observations in each treatment group.
-
Decision Rule: Any absolute difference between two sample means that exceeds the calculated HSD value is declared statistically significant.
18.10 Tukey-Kramer Method (Unequal Sample Sizes)
When sample sizes across treatment groups are unequal, Tukey's HSD test (Equation 8.2.9) is not directly applicable. The Tukey-Kramer method extends Tukey's procedure by adjusting the standard error term.
-
HSD Calculation (Unequal Sample Sizes): HSDKramer=qα,k,N−k2MSE(ni1+nj1) where ni and nj are the sample sizes of the two groups being compared.
-
Decision Rule: If the absolute difference between two sample means is greater than HSDKramer, the difference is considered significant.
Example: Applying Tukey's test to Example 8.2.1 with unequal sample sizes, the differences between means were compared against the calculated HSDKramer values for each pair. For instance, the difference between the VEN and SQU means (17.37 dollars) exceeded the calculated HSDKramer of 10.04 dollars, leading to the rejection of the null hypothesis that their means are equal 343.
18.11 Bonferroni's Method
Bonferroni's method is another common approach to multiple comparisons that controls the family-wise error rate. It is based on dividing the overall significance level (α) by the number of pairwise comparisons.
-
Bonferroni Correction: Instead of testing at significance level α, each pairwise comparison is tested at a corrected significance level of α∗=kα, where k is the number of pairwise comparisons (e.g., for m groups, k=2m(m−1)).
-
Decision Rule: A null hypothesis for a pair of means is rejected if its p-value is less than or equal to the corrected significance level (α∗).
Tip: Many statistical software packages provide Bonferroni-corrected p-values directly, simplifying the decision-making process. The overall α can be calculated as the sum of the corrected p-values multiplied by the number of tests performed (i.e., α=k×p) 342.
19. Analysis of variance and regression analysis (part 3)
This section focuses on advanced analysis of variance (ANOVA) designs, specifically the randomized complete block design, and introduces the framework for analyzing such data.
19.1 The randomized complete block design
The randomized complete block design, developed by R. A. Fisher, is employed when experimental units can be subdivided into homogeneous groups called blocks. The key characteristic is that each treatment appears exactly once within each block, and treatments are assigned randomly to experimental units within each block. This design aims to isolate and remove variation attributable to blocks from the error term, thereby increasing the power to detect treatment effects.
Note: The effectiveness of this design hinges on the ability to form homogeneous blocks. This requires prior knowledge of the experimental material. When blocking is effective, the error mean square is reduced, the variance ratio (V.R.) increases, and the probability of rejecting a false null hypothesis is improved.
19.2 Objective and application
The primary objective is to account for variability introduced by blocks, ensuring that treatment means are not confounded by block effects. Common applications include:
- Animal experiments: Using breed or litters as blocking factors.
- Human experiments: Grouping subjects by age or other relevant characteristics.
- Multi-laboratory or multi-day experiments: Using laboratories or days as blocks.
19.3 Random allocation of treatments
The random allocation of treatments is restricted: each treatment must appear an equal number of times within each blocking unit. This is typically achieved by assigning a random permutation of treatments to the experimental units within each block.
Example: For four treatments (A, B, C, P), there are 4!=24 possible permutations. One permutation is randomly assigned to each block.
19.4 Advantages and relationship to paired comparisons
A significant advantage of the randomized complete block design is its simplicity and ease of understanding. It also handles potential experimental complications effectively. The paired comparisons analysis, previously discussed, is a special case of the randomized complete block design where there are two treatments and individuals serve as blocks 353.
19.5 Data display and notation
Data from a randomized complete block design can be organized in a table where rows represent blocks and columns represent treatments. Key notation includes:
- Ti: = Total of the i-th block.
- xˉi: = Mean of the i-th block.
- T:j = Total of the j-th treatment.
- xˉ:j = Mean of the j-th treatment.
- T:: = Grand total.
- xˉ:: = Grand mean.
19.6 Two-way ANOVA
The analysis technique for this design is two-way analysis of variance because observations are classified by two factors: block and treatment.
19.7 Steps of hypothesis testing for randomized complete block design
-
Data: Organize data by treatments and blocks.
-
Assumptions:
- The Model: xij=μ+bi+tj+eij, where xij is the observed value, μ is a constant, bi is the block effect, tj is the treatment effect, and eij is the residual error 354.
- Assumptions of the Model:
- Each xij is a random, independent sample of size 1 from its respective population.
- The kn populations are normally distributed with mean μij and common variance σ2. This implies eij are independently and normally distributed with mean 0 and variance σ2.
- Block and treatment effects are additive (no interaction). A rule of thumb for checking interaction is if the largest mean is more than 50% greater than the smallest.
- Fixed-Effects Model: When assumptions hold, tj and bi are fixed constants.
-
Hypotheses:
- H0:tj=0 for all j (no treatment effects).
- HA: Not all tj=0 (at least one treatment effect is non-zero).
- Hypothesis tests for block effects are typically not performed as the primary goal is treatment comparison, and blocks are obtained non-randomly.
-
Test statistic: The variance ratio, V.R.=MSEMSTr.
-
Distribution of test statistic: Under H0 and satisfied assumptions, V.R. follows an F distribution.
-
Decision rule: Reject H0 if the computed V.R. is greater than or equal to the critical F value 355.
-
Calculation of test statistic:
- Total Sum of Squares (SST): SST=∑j=1k∑i=1nxij2−nkT::2.
- Sum of Squares for Blocks (SSBl): SSBl=∑i=1nkTi:2−nkT::2.
- Sum of Squares for Treatments (SSTr): SSTr=∑j=1knT:j2−nkT::2.
- Sum of Squares for Error (SSE): SSE=SST−SSBl−SSTr.
- Degrees of Freedom (d.f.):
- Total: kn−1
- Blocks: n−1
- Treatments: k−1
- Residual Error: (n−1)(k−1).
- ANOVA Table: Results are summarized in an ANOVA table 356.
-
Statistical decision: Compare the computed V.R. with the critical F value from the F distribution table.
-
Conclusion: State whether to reject or fail to reject H0.
-
p-value: Determine the probability of observing the test statistic or a more extreme one if H0 is true 357.
19.8 Example of randomized complete block design analysis
An example is provided where a physical therapist compares three methods for teaching patients to use a prosthetic device, considering age as a blocking factor. 357-358 The data are organized into a table with age groups as blocks and teaching methods as treatments. The ANOVA table is constructed, and the hypothesis test leads to the conclusion that not all treatment means are equal 358.
Important: Statistical software packages like MINITAB and SAS can perform these analyses. The output typically includes the ANOVA table, variance ratio (F value), p-value, and confidence intervals for mean differences.
Tip: If the assumptions of the randomized complete block design are not met, the Friedman procedure, a nonparametric alternative, may be appropriate 359.
This section presents examples of analysis of variance (ANOVA) problems, specifically illustrating the application of ANOVA techniques to experimental designs and comparing means across different groups or conditions.
19.9 Examples of Analysis of Variance Applications
The following examples demonstrate the practical application of ANOVA in various research scenarios, focusing on determining if significant differences exist among the means of different treatment groups or conditions.
19.10 Nicotine gum and tic frequency
This example involves analyzing the tic frequencies of patients with Tourette's disorder under four different conditions related to chewing nicotine gum. The objective is to determine if there is a significant difference in mean tic frequency among these conditions after accounting for individual patient effects 362.
19.11 Remotivation methods in a psychiatric hospital
An experiment was conducted to compare five different methods for remotivating psychiatric patients. Patients were categorized by their initial motivation level, and then randomly assigned to one of the five methods. The effectiveness of each method was measured by a composite score assigned by a multidisciplinary team. The analysis aims to ascertain if there is a significant difference in the mean motivation scores among the five remotivation methods.
19.12 Time of day and length of home visits
A nursing supervisor investigated the influence of the time of day on the duration of home visits made by nursing staff. To control for individual differences among nurses, the nurse was used as a blocking factor. The study collects data on the length of home visits at different times of the day, and the analysis seeks to determine if there are significant differences in the mean length of home visits across these times.
19.13 Effectiveness of stress-relieving methods
An experiment involved four subjects participating in a study to compare three methods for relieving stress. Each subject experienced a stressful situation on three separate occasions, with a different stress-relieving method applied each time. The response variable measured was the decrease in stress level after treatment. The analysis aims to determine if the three methods differ significantly in their effectiveness in reducing stress 363.
20. Analysis of variance and regression analysis (part 4)
This section delves into advanced experimental designs and analytical techniques, focusing on repeated measures designs and factorial experiments within the broader context of analysis of variance, and introducing the foundational concepts of regression analysis.
20.1 Repeated measures design
A repeated measures design is a statistical approach where measurements of the same variable are taken from each subject on two or more distinct occasions. These occasions can represent different points in time or varying experimental conditions, such as different treatments. This design is particularly valuable in health sciences for controlling subject-to-subject variability, as each subject essentially acts as their own control.
Advantages of Repeated Measures Designs:
- Controls for extraneous variation among subjects: By using each subject as their own control, individual differences that could otherwise confound results are accounted for.
- Fewer subjects required: Compared to designs where different subjects are used for each condition or time point, repeated measures designs are more efficient in terms of sample size, which is beneficial when subjects are scarce or costly to recruit.
Disadvantages of Repeated Measures Designs:
- Carry-over effect: A subject's response to one treatment might be influenced by residual effects from previous treatments. This can often be mitigated by allowing sufficient time between treatments.
- Position effect: A subject's response to a treatment might depend on its position in the sequence (e.g., enthusiasm waning over time). Randomizing the order of treatments for each subject independently can help address this.
20.2 Single-factor repeated measures design
This design is the simplest form of repeated measures analysis, where, in addition to the primary treatment variable, one additional factor is considered to measure and isolate its contribution to overall variability. This additional factor is commonly referred to as "subjects," and each subject receives every treatment. The order of treatment exposure is typically randomized independently for each subject.
Assumptions of the single-factor repeated measures design (fixed-effects additive design):
- Subjects are a simple random sample from a population of similar subjects.
- Observations are independent simple random samples from different populations (one for each subject-treatment combination).
- Populations have potentially different means but share the same variance.
- Treatments are fixed, meaning inferences are limited to the specific treatments studied.
- No interaction between treatments and subjects; effects are additive.
A crucial underlying assumption is that correlations exist among repeated measures taken on the same individual over time. The repeated measures ANOVA design specifically assumes that all these correlations are equal, a condition known as compound symmetry, which, along with equal variances, is termed sphericity. Violations of sphericity can lead to an inflated Type I error rate, though statistical software often provides tests and adjustments for this.
The model for this design is: xij=μ+bi+τj+eij where:
- xij is the observation for subject i under treatment j.
- μ is the overall mean.
- bi is the effect of subject i.
- τj is the effect of treatment j.
- eij is the random error term.
This model is structurally identical to that of the randomized complete block design, with subjects serving as blocks.
Example 8.4.1 (Licciardone et al.): This study examined physical functioning scores in subjects with low back pain over four time points (baseline, 1, 3, and 6 months). The goal was to determine if mean survey values differed across these time points. The analysis involved a repeated measures ANOVA to test the hypothesis that all mean scores were equal. The output from statistical software like MINITAB, SAS, or SPSS would provide the F-statistic, degrees of freedom, and p-value to make a statistical decision regarding the null hypothesis 366.
20.3 Two-factor repeated measures design
This design extends the repeated measures concept to scenarios involving two factors, one of which is a within-subjects factor (like time or repeated conditions), and the other is a between-subjects factor (like different treatment groups). The analysis aims to assess differences among times for different treatment groups, as well as potential interactions between these factors.
Assumptions: Similar to the single-factor design, with an additional consideration for potential interactions. Statistical software is typically used to handle complex interaction calculations.
The model for the two-factor repeated measures design is: xijk=μ+rij+αi+βj+(αβ)ij+ϵijk
- xijk is the observation for block i, factor A level j, and factor B level k.
- rij represents a block effect.
- αi represents the main effect of factor A.
- βj represents the main effect of factor B.
- (αβ)ij represents the interaction effect of factor A and factor B.
- ϵijk is the residual error component.
Example 8.4.2 (Mid-Michigan Medical Center): This study investigated oral health condition scores in 25 neck cancer patients over four time points (baseline, 2, 4, and 6 weeks) across two treatment groups: a placebo and an aloe juice treatment. The analysis sought to detect changes in oral health over time, differences between the two treatments, and any interaction between time and treatment. SPSS was used to perform the analysis, including Mauchly's Test of Sphericity to check assumptions. The results indicated a significant change in oral condition over time but no significant difference between treatments or a significant interaction effect 370.
20.4 The factorial experiment
A factorial experiment is designed to simultaneously investigate the effects of two or more variables, termed "factors." Each factor is defined by distinct categories called "levels." The primary advantage of a factorial experiment is its ability to study not only the main effects of individual factors but also the interactions between them.
Interaction: Interaction between two factors occurs when the effect of one factor on the response variable differs at different levels of the other factor. This means the factors do not act independently.
Example 8.5.1 (Drug Dosage and Age): This example illustrates interaction by showing mean reductions in reaction time. In the absence of interaction, the effect of drug dosage would be consistent across age groups, and vice versa, resulting in parallel lines when plotted. When interaction is present, these effects are not independent; for instance, the difference in reaction time between two drug dosages might be large for young subjects but small or reversed for old subjects 377.
Advantages of Factorial Experiments:
- Study of interactions: Allows for the detection and analysis of how factors influence each other.
- Efficiency: A single factorial experiment is more economical in terms of time, effort, and experimental units than conducting separate experiments for each factor. All observations contribute to the estimation of each factor's main effect.
- Wider range of application: The combined study of factors leads to results that are more broadly applicable.
20.5 The two-factor completely randomized design
This design is a common approach to analyzing a factorial experiment where two factors are studied using a completely randomized design. Each combination of the levels of the two factors (Factor A and Factor B) constitutes a treatment.
The model for a two-factor completely randomized design (assuming no interaction for simplicity here, though the full model includes interaction) is: xijk=μ+αi+βj+(αβ)ij+ϵijk
- xijk is the kth observation for the ith level of Factor A and jth level of Factor B.
- αi is the main effect of the ith level of Factor A.
- βj is the main effect of the jth level of Factor B.
- (αβ)ij is the interaction effect between the ith level of Factor A and jth level of Factor B.
- ϵijk is the random error.
Data from a two-factor completely randomized design are typically presented in a table showing totals and means for each combination of factor levels (cells), as well as overall totals and means 379.
This section focuses on the factorial experiment, a type of completely randomized design used to analyze the effects of two or more factors and their interactions on a response variable.
20.6 The factorial experiment
A factorial experiment investigates the effects of multiple independent variables (factors) on a dependent variable. In a two-factor completely randomized design, each combination of the levels of the two factors constitutes a treatment. For instance, if Factor A has a levels and Factor B has b levels, there are ab treatment combinations. To test for interactions between factors, at least two observations per treatment combination (cell) are required. This design is analyzed using two-way analysis of variance.
20.7 Model and assumptions
The fixed-effects model for a two-factor completely randomized design is represented as:
- xijk is the typical observation.
- μ is a constant.
- αi is the effect due to factor A at level i.
- βj is the effect due to factor B at level j.
- (αβ)ij is the effect due to the interaction of factors A and B at levels i and j.
- ϵijk is the experimental error.
The key assumptions for this model are:
- Independence and Random Sampling: Observations within each cell (combination of factor levels) are random, independent samples of size n from the corresponding population.
- Normality: Each of the ab populations is normally distributed.
- Homogeneity of Variance: All populations share the same variance.
Note: The text mentions that for a randomized complete block design, only one observation per cell is needed, contrasting with the factorial experiment's requirement of at least two observations per cell to test for interaction 380.
20.8 Hypotheses
The factorial experiment allows for testing three main sets of hypotheses:
- Main effect of Factor A:
- H0:αi=0 for all i (The mean effect of Factor A is zero).
- HA: not all αi=0.
- Main effect of Factor B:
- H0:βj=0 for all j (The mean effect of Factor B is zero).
- HA: not all βj=0.
- Interaction effect of Factors A and B:
- H0:(αβ)ij=0 for all i,j (There is no interaction effect between Factor A and Factor B).
- HA: not all (αβ)ij=0.
Important: When testing all three hypotheses simultaneously, the significance levels are not independent. The overall significance level (α) will be greater than the individual significance levels (α0,α00,α000) of each test. For instance, if α0=α00=α000=0.05, the overall α could be less than 0.143.
20.9 Test statistic and distribution
The test statistic for each hypothesis set is the Variance Ratio (V.R.), which follows an F-distribution when the null hypothesis is true and the assumptions are met 381.
20.10 Calculation of test statistics
The total sum of squares (SST) in a factorial experiment can be partitioned into the sum of squares for treatments (SSTr) and the sum of squares for experimental error (SSE): SST=SSTr+SSE The sum of squares for treatments can be further partitioned to isolate the effects of each factor and their interaction: SSTr=SSA+SSB+SSAB
- SSA is the sum of squares for Factor A.
- SSB is the sum of squares for Factor B.
- SSAB is the sum of squares for the interaction between A and B.
20.11 Analysis of Variance (ANOVA) Table
The results of the analysis are typically presented in an ANOVA table, which summarizes the sums of squares, degrees of freedom (d.f.), mean squares (MS), and variance ratios (V.R.) for each source of variation:
| Source | SS | d.f. | MS | V.R. |
|---|---|---|---|---|
| A | SSA | a−1 | MSA=a−1SSA | MSA/MSE |
| B | SSB | b−1 | MSB=b−1SSB | MSB/MSE |
| AB | SSAB | (a−1)(b−1) | MSAB=(a−1)(b−1)SSAB | MSAB/MSE |
Example: A study investigated the length of home visits by public health nurses, considering the nurse's age group and the type of patient. The researchers aimed to determine if age groups differ in visit length, if patient type affects visit length, and if there's an interaction between age and patient type. Data were collected from 80 nurses, and the analysis assumed a fixed-effects model and a two-factor completely randomized design. Hypotheses were formulated for the main effects of nurse's age and patient type, as well as their interaction, with a significance level of 0.05 383.
21. Analysis of variance and regression analysis (part 5)
This section focuses on the application and interpretation of factorial experiments within the framework of Analysis of Variance (ANOVA) and introduces the initial concepts of regression analysis.
21.1 Factorial experiments
A factorial experiment is designed to investigate the effects of two or more factors simultaneously. In this context, a two-factor completely randomized fixed-effects factorial model is represented by the equation: xijk=μ+ai+bj+(ab)ij+eijk where:
- xijk is the response for the k-th observation in the i-th level of factor A and j-th level of factor B.
- μ is the grand mean.
- ai is the effect of the i-th level of factor A.
- bj is the effect of the j-th level of factor B.
- (ab)ij is the interaction effect between the i-th level of factor A and the j-th level of factor B.
- eijk is the random error term.
The total sum of squares (SST) in a factorial experiment can be partitioned into components representing the sum of squares for treatments (SSTr) and the sum of squares for error (SSE). The SSTr can be further decomposed to isolate the effects of individual factors (A and B) and their interaction.
Example: In Example 8.5.2, a two-factor experiment was conducted to analyze the average amount of time spent in home visits. Factor A represented the type of patient (with 4 levels), and Factor B represented the nurse's age group (with 4 levels). The analysis involved testing hypotheses about the main effects of patient type and nurse's age group, as well as the interaction effect between patient type and nurse's age group. The analysis revealed statistically significant differences for all three hypotheses, indicating that both patient type and nurse's age group had an effect on visit time, and importantly, there was a significant interaction effect, suggesting that the combination of patient type and nurse's age group influenced the time spent387.
When analyzing factorial experiments, especially with multiple factors, statistical software packages like MINITAB and SAS are commonly used to perform the calculations and generate ANOVA tables. These outputs typically include the sources of variation (e.g., Factor A, Factor B, Interaction, Error), degrees of freedom (DF), sum of squares (SS), mean squares (MS), F-statistics, and p-values 386.
Note: The analysis of factorial experiments becomes more complex when the number of observations per cell (combination of factor levels) is unequal, a situation referred to as an "unbalanced" design. Specialized procedures like the General Linear Model (GLM) in MINITAB or similar functions in other statistical software are required for analyzing such designs.
21.2 Interpreting factorial ANOVA results
The interpretation of a factorial ANOVA involves examining the significance of the main effects and the interaction effect.
- Main Effects: These tests determine if there are significant differences among the levels of each individual factor, averaged across the levels of the other factor(s).
- Interaction Effect: This test is crucial as it assesses whether the effect of one factor depends on the level of another factor. A significant interaction implies that the factors do not act independently.
Decision Rule: If the computed value of the test statistic (F-statistic) is equal to or greater than the critical value of F (or if the p-value is less than the chosen significance level, typically α=0.05), the null hypothesis is rejected 384.
When a significant interaction is detected, the interpretation of the main effects should be done with caution. In such cases, the focus often shifts to understanding the nature of the interaction, possibly through post-hoc tests or by examining simple effects (the effect of one factor at a specific level of another factor) 385.
The provided exercises (8.5.1 to 8.5.4) offer practical applications of factorial ANOVA, covering scenarios with equal and unequal cell sizes, and prompting the application of hypothesis testing and interpretation of results in various research contexts, from neuroprotection to patient rehabilitation and headache frequency 390 391.
This section covers exercises and applications related to the analysis of variance (ANOVA) and regression techniques, including specific experimental designs and the interpretation of ANOVA tables.
21.3 Analysis of variance problems
This subsection presents problems that require the application and completion of Analysis of Variance (ANOVA) tables for various experimental designs.
-
Problem 26: This problem involves completing an ANOVA table for a certain experimental design, given the Sum of Squares (SS) for Treatments and Total, and the degrees of freedom (d.f.) for Treatments and Total. The task is to calculate the remaining SS and d.f. values, as well as the Mean Squares (MS) and Variance Ratio (V.R.) or F-statistic, and the corresponding p-value. This likely pertains to a Completely Randomized Design (CRD) given the structure of the provided information.
- Given:
- SS Treatments = 154.9199
- d.f. Treatments = 4
- SS Total = 200.4773
- d.f. Total = 39
- To find: SS Error, d.f. Error, MS Treatments, MS Error, V.R., p
The design used is likely a Completely Randomized Design (CRD), as the ANOVA table structure focuses on Treatments and Error without explicit mention of Blocks or other factors besides the primary experimental treatment.
- Given:
-
Problem 27: This problem requires completing an ANOVA table that includes sources for Treatments, Blocks, and Error, implying a design that accounts for blocking. The Sum of Squares for Blocks and Error, along with the degrees of freedom for Treatments and Total, are provided.
* SS Blocks = 183.5 * SS Error = 26.0 * d.f. Treatments = 3 * d.f. Total = 15- To find: SS Treatments, d.f. Blocks, d.f. Error, MS Treatments, MS Blocks, MS Error, V.R., p
The design used is likely a Randomized Complete Block Design (RCBD), indicated by the presence of both "Treatments" and "Blocks" as sources of variation in the ANOVA table.
-
Problem 28: This problem provides a completed ANOVA table for a two-factor experiment, including main effects for factors A and B, and their interaction (AB). The task is to interpret the results and potentially draw conclusions.
- ANOVA Table:
Source SS d.f. MS V.R. p A 12.3152 2 6.15759 29.4021 <.005 B 19.7844 3 6.59481 31.4898 <.005 AB 8.94165 6 1.49027 7.11596 <.005
Interpretation:
- Main Effect A: The p-value (<.005) indicates a statistically significant main effect for factor A.
- Main Effect B: The p-value (<.005) indicates a statistically significant main effect for factor B.
- Interaction AB: The p-value (<.005) indicates a statistically significant interaction between factors A and B. This means the effect of one factor depends on the level of the other factor.
The design used here is a Factorial Experiment, specifically a two-way factorial experiment, due to the presence of main effects for two factors (A and B) and their interaction term (AB). The "Treatments" row likely represents the sum of SS for A, B, and AB, though this is not a standard ANOVA table row in all contexts.
- ANOVA Table:
22. Analysis of variance and regression analysis (part 6)
This section delves into fundamental statistical techniques for comparing group means and modeling relationships between variables, covering various analysis of variance (ANOVA) designs and regression analyses.
22.1 Analysis of variance (ANOVA) designs
ANOVA is a statistical method used to partition the total variation in a dataset into different sources of variation, allowing for the comparison of means across two or more groups. The core principle is to test whether the variation between group means is significantly larger than the variation within groups.
-
Completely Randomized Design (CRD):
- This is the simplest design where experimental units are randomly assigned to different treatments.
- All experimental units are considered homogeneous, and the only source of variation considered beyond treatments is random error.
- It is efficient when there are no known sources of extraneous variation.
- Commonly used for comparing the means of several independent samples.
- Appropriate when there are no inherent groupings or blocking factors to consider.
-
Randomized Complete Block Design (RCBD):
- Used to reduce variability in experimental results by grouping experimental units into blocks based on a known source of variation (a blocking variable).
- Within each block, treatments are randomly assigned to the experimental units.
- This design helps to isolate the effect of the blocking variable, leading to a more precise estimation of treatment effects.
- The blocking variable should be a factor that is expected to influence the response variable.
- Example: If studying the effect of different fertilizers on crop yield, blocks could be different plots of land with varying soil fertility.
-
Repeated Measures Design:
- Involves measuring the same experimental unit multiple times under different treatment conditions or over time.
- This design is useful when the experimental unit is costly or difficult to obtain, or when studying changes over time.
- Each subject serves as their own control, which can increase the power of the study by reducing inter-subject variability.
- Analysis must account for the correlation between measurements from the same subject.
- Example: Measuring blood pressure of the same individuals at baseline, after 3 months, and after 6 months of a new medication.
-
Factorial Experiments:
- Designed to study the effects of two or more factors simultaneously.
- Each treatment combination consists of a unique pairing of levels from each factor.
- Allows for the investigation of not only the main effects of each factor but also their interactions.
- An interaction occurs when the effect of one factor on the response variable depends on the level of another factor.
- Example: Studying the effect of both fertilizer type and irrigation frequency on plant growth.
22.2 Regression analysis
Regression analysis is a set of statistical processes for estimating the relationships between a dependent variable (often called the outcome or response variable) and one or more independent variables (often called predictors, covariates, or features). The primary goal is to model and understand how the independent variables influence the dependent variable, and to use this model for prediction.
-
Simple Linear Regression:
- Models the linear relationship between a single independent variable (x) and a dependent variable (y).
- The model is represented by the equation:
y=β0+β1x+ϵ
where:
- y is the dependent variable.
- x is the independent variable.
- β0 is the y-intercept (the predicted value of y when x is 0).
- β1 is the slope (the change in y for a one-unit increase in x).
- ϵ is the error term, representing the unexplained variation in y.
- The goal is to estimate β0 and β1 using methods like Ordinary Least Squares (OLS) to minimize the sum of squared errors.
-
Multiple Linear Regression:
- Extends simple linear regression to include two or more independent variables (x1,x2,…,xk).
- The model equation is:
y=β0+β1x1+β2x2+…+βkxk+ϵ
- x1,x2,…,xk are the independent variables.
- β0 is the intercept.
- β1,β2,…,βk are the regression coefficients, representing the change in y for a one-unit increase in the corresponding x, holding all other independent variables constant.
- ϵ is the error term.
- This allows for a more comprehensive understanding of how multiple factors contribute to the outcome.
-
Correlation Analysis:
- Measures the strength and direction of the linear relationship between two quantitative variables.
- The correlation coefficient, typically denoted by r, ranges from -1 to +1.
- r=+1 indicates a perfect positive linear relationship.
- r=−1 indicates a perfect negative linear relationship.
- r=0 indicates no linear relationship.
- While regression analysis aims to predict one variable from another, correlation analysis simply quantifies the association.
-
Logistic Regression:
- Used when the dependent variable is binary (dichotomous), meaning it can take only two values (e.g., yes/no, success/failure, alive/dead).
- Instead of predicting the probability directly, logistic regression models the log-odds of the outcome as a linear function of the independent variables.
- The model uses the logistic (sigmoid) function to transform the linear combination of predictors into a probability between 0 and 1.
- The equation for the probability of the outcome (P(y=1)) is: P(y=1)=1+eβ0+β1x1+…+βkxkeβ0+β1x1+…+βkxk or equivalently, the log-odds: log(1−P(y=1)P(y=1))=β0+β1x1+…+βkxk
- Often used in fields like medicine and social sciences for classification and risk prediction.
Note: Both ANOVA and regression techniques assume that the errors are independent and normally distributed with constant variance. Violations of these assumptions can affect the validity of the results. [404-412 Example: A researcher wants to understand the relationship between hours of study and exam scores. They could use simple linear regression with hours of study as the independent variable and exam score as the dependent variable to model this relationship and predict scores for different study hours.
Important: When interpreting regression coefficients in multiple linear regression, it is crucial to remember that each coefficient represents the effect of its corresponding predictor variable while holding all other predictors in the model constant.
Tip: Factorial experiments are particularly powerful for uncovering synergistic or antagonistic effects between factors, which might be missed if factors were studied in isolation 406.
This section focuses on illustrative examples of data collected for analysis of variance and regression studies, demonstrating practical applications of these statistical techniques.
22.3 Bone disease and serum alkaline phosphatase analysis
This example presents serum alkaline phosphatase (IU/L) data from patients with varying degrees of bone change, categorized into Grade I, Grade II, and Grade III, as part of a study on the association between calcium metabolism and bone diseases in individuals with disabilities.
- Grade I: 109, 86, 79, 103, 47, 105, 188, 96, 249.
- Grade II: 86, 106, 164, 146, 111, 263, 162, 111.
- Grade III: 283, 201, 208, 301, 135, 192, 135, 83, 193, 175, 174, 193, 224, 192, 233.
22.4 Dietary copper deficiency in rats: Organ and blood measurements
This study investigated the effects of dietary copper deficiency on rats, comparing copper-deficient (CuD), copper-adequate (CuA), and pair-fed (PF) groups. Data collected after 20 weeks include body weight (BW), heart weight (HW), liver weight (LW), kidney weight (KW), spleen weight (SW), various organ weight to body weight ratios, and ceruloplasmin levels
Note: The pair-fed (PF) group was used to control for the effects of reduced food intake in the copper-deficient group. Rats in the PF group were weight-matched to CuD rats and fed the same weight of the CuA diet as consumed by their CuD counterparts.
The following table summarizes some of the collected data:
| Rat | Diet | Body weight (BW)(g) | Heart weight (HW)(g) | Liver weight (LW)(g) | Kidney weight (KW)(g) | Spleen weight (SW)(g) | HW/BW (g/100 g) | LW/BW (g/100 g) | KW/BW (g/100 g) | SW/BW (g/100 g) | Ceruloplasmin (mg/dl) |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 3 | CuD | 355.89 | 1.24 | 5.15 | 2.27 | 0.69 | 0.00348 | 0.01447 | 0.00638 | 0.00194 | 4.80 |
| 8 | PF | 386.87 | 0.88 | 3.05 | 1.86 | 0.84 | 0.00227 | 0.00788 | 0.00481 | 0.00217 | 28.00 |
| 13 | CuA | 485.51 | 1.36 | 4.40 | 2.46 | 0.82 | 0.00280 | 0.00906 | 0.00507 | 0.00169 | 37.10 |
422.
22.5 Acute pancreatitis study: Hematocrit levels
This section details hematocrit (%) values from a study on acute pancreatitis using a bile-infusion model. Adult male Sprague-Dawley rats were divided into three groups: untreated, treated (with anti-TNFa antibody), and sham (saline infused). The data presented are for animals surviving more than 48 hours.
Important: Proinflammatory cytokines, particularly TNF-alpha, are hypothesized to play a central role in mediating systemic complications of acute pancreatitis, which are a major cause of mortality.
| Sham | Untreated | Treated |
|---|---|---|
| 38 | 56 | 40 |
| 40 | 60 | 42 |
| 32 | 50 | 38 |
| 36 | 50 | 46 |
| 40 | 50 | 36 |
22.6 Pre-eclampsia and endothelial cell damage study
This research investigated observations that sera from pre-eclamptic women could damage cultured human endothelial cells. The study included subjects with pre-eclampsia, matched control women with normal pregnancies, and nonpregnant women 423.
23. Analysis of variance and regression analysis (part 7)
This section introduces the foundational concepts and assumptions of simple linear regression and correlation analysis, focusing on understanding and modeling relationships between two numerical variables.
23.1 Introduction to regression and correlation
Regression and correlation analysis are statistical techniques used to explore the relationships between two numerical variables. Regression analysis focuses on predicting or estimating the value of one variable based on another, while correlation analysis measures the strength of the linear association between variables. Both techniques were significantly developed by Sir Francis Galton. This section, specifically, is dedicated to exploring linear relationships between two variables, with regression discussed first, followed by correlation.
Note: Regression and correlation analyses are greatly enhanced by the use of computers due to the speed and accuracy they offer. The data sets for exercises are typically provided in a format suitable for computer processing 431.
23.2 The regression model
The simple linear regression model is used when researchers have sample data and wish to make inferences about the population from which the sample was drawn. The goal is to determine if a chosen mathematical model, such as a linear relationship, is an appropriate representation of the population. While perfect model fit is rare and often impractical, the model should be a reasonable approximation to yield useful results 432.
23.3 Assumptions of the simple linear regression model
In the simple linear regression model, two variables, X (independent) and Y (dependent), are considered. The independent variable X is often preselected by the investigator, and for each value of X, one or more values of Y are observed. The following assumptions are critical for inferential procedures in this model:
- Fixed values of X: The values of the independent variable X are preselected and do not vary randomly during data collection. This defines the classical regression model, though regression can also be performed when X is a random variable.
- X is measured without error: The magnitude of any measurement error in X is considered negligible.
- Normality of Y subpopulations: For each value of X, the subpopulation of Y values is normally distributed. This is necessary for valid estimation and hypothesis testing.
- Equal variances of Y subpopulations: The variances of all subpopulations of Y are equal, denoted as σ2.
- Linearity of means: The means of the subpopulations of Y values lie on a straight line. This is expressed as μY∣X=β0+β1x, where β0 is the y-intercept and β1 is the slope of the population regression line 433.
- Independence of Y values: The Y values are statistically independent; that is, the selection of Y values for one X does not influence the selection of Y values for another X.
These assumptions can be remembered using the acronym LINE: Linear (assumption 5), Independent (assumption 6), Normal (assumption 3), Equal variances (assumption 4).
The simple linear regression model is mathematically expressed as: y=β0+β1x+ϵ where y is a typical value from a subpopulation of Y, β0 and β1 are the population regression coefficients, and ϵ is the error term. The error term, ϵ=y−(β0+β1x), represents the deviation of an individual y value from its subpopulation mean μY∣X.
Important: A graphical representation of the simple linear regression model shows the population regression line (μY∣X=β0+β1x) and the distribution of Y values around this line for different values of X 434.
23.4 The sample regression equation
The primary goal in regression analysis is to understand the population regression equation, which describes the true relationship between the dependent variable Y (response variable) and the independent variable X (predictor variable). To achieve this, researchers collect sample data, compute a sample regression equation, and use it to make inferences about the population equation.
23.5 Steps in regression analysis
A common strategy when extensive prior information about the variables is lacking is to initially assume a linear relationship. The subsequent steps in regression analysis are:
- Verify assumptions: Determine if the data conform to the assumptions underlying a linear relationship.
- Fit the best line: Obtain the equation for the line that best fits the sample data.
- Evaluate the equation: Assess the strength of the relationship and the usefulness of the equation for prediction and estimation.
- Utilize the equation: If the data fit the linear model satisfactorily, use the obtained equation for prediction and estimation.
Tip: When using the regression equation for prediction, we estimate a specific Y value for a given X. When using it for estimation, we estimate the mean of the Y subpopulation at a given X value. The sample data provides known values for both X and Y, whereas prediction and estimation involve knowing only X.
23.6 Example of regression analysis application
The study by Despr es et al. (A-1) aimed to predict the amount of deep abdominal adipose tissue (AT) using simple anthropometric measurements like waist circumference, as computed tomography (CT) scans, while precise, are costly and involve irradiation. This exemplifies a scenario where a researcher develops a predictive equation to estimate a costly-to-measure variable (deep abdominal AT) from an easily obtainable one (waist circumference) 435.
This section introduces simple linear regression and correlation, focusing on understanding and quantifying the linear relationship between two continuous variables.
23.7 Understanding relationships with scatter diagrams and regression
The initial step in analyzing the relationship between two continuous variables is to visualize the data.
- Scatter Diagram: A scatter diagram plots individual data points, with the independent variable (X) on the horizontal axis and the dependent variable (Y) on the vertical axis. This visual representation helps identify the general nature and strength of the relationship.
- Purpose of Scatter Diagrams: They reveal patterns such as linear trends, non-linear trends, clusters, and outliers. For instance, a scatter plot can indicate if an increase in X is associated with an increase in Y (positive relationship), a decrease in Y (negative relationship), or no discernible pattern.
Example: In analyzing the relationship between waist circumference (X) and deep abdominal adipose tissue (AT) (Y), a scatter diagram would show if individuals with larger waist circumferences tend to have higher amounts of abdominal AT 437.
23.8 The least-squares regression line
When a linear relationship is suggested by the scatter diagram, the next step is to quantify this relationship using a regression line. The least-squares line is the statistically preferred method for fitting a straight line to the data.
- Linear Equation: The general equation for a straight line is y=a+bx, where:
- a is the y-intercept (the value of y when x is 0).
- b is the slope (the change in y for a one-unit increase in x).
- Least-Squares Criterion: This method finds the line that minimizes the sum of the squared vertical deviations of the observed data points from the line. In simpler terms, it finds the line that best fits the data by making the sum of the squared errors as small as possible.
- The sum of squared vertical deviations for the least-squares line is smaller than that for any other line.
23.9 Calculating the least-squares regression equation
The coefficients for the least-squares regression line are typically calculated using statistical software due to the complexity of manual computation. The estimated regression equation is often denoted as y^=b^0+b^1x, where y^ represents the predicted value of Y, and b^0 and b^1 are the estimates of the intercept and slope, respectively.
The formulas for the coefficients are:
-
Slope (b^1): b^1=∑i=1n(xi−xˉ)2∑i=1n(xi−xˉ)(yi−yˉ) This can also be expressed using sums of products: b^1=n∑xi2−(∑xi)2n∑xiyi−(∑xi)(∑yi) where xi and yi are the individual data points, xˉ and yˉ are the sample means, and n is the number of data points.
-
Intercept (b^0): b^0=yˉ−b^1xˉ This ensures the regression line passes through the mean point (xˉ,yˉ).
Note: While these formulas are provided, statistical software packages are the standard tool for obtaining these values in practice due to computational efficiency and accuracy 438.
23.10 Interpreting the regression equation
Once the regression equation is obtained, its components can be interpreted in the context of the data.
- Intercept (b^0): Represents the predicted value of the dependent variable (Y) when the independent variable (X) is zero. This interpretation is only meaningful if X=0 is within the plausible range of the data. In the example of waist circumference and abdominal AT, a negative intercept would imply that at a waist circumference of zero, abdominal AT would be predicted as negative, which is biologically impossible, highlighting the limitations of extrapolating beyond the observed data range.
- Slope (b^1): Represents the average change in the dependent variable (Y) for a one-unit increase in the independent variable (X). A positive slope indicates a positive association, while a negative slope indicates a negative association.
- Predicted Value (y^): The value of y^ calculated from the regression equation represents the predicted or estimated value of the dependent variable for a given value of the independent variable.
Example: For the relationship between waist circumference (X) and deep abdominal AT (Y), the estimated regression equation was y^=−216+3.46x This indicates that for every one-centimeter increase in waist circumference, the deep abdominal AT is predicted to increase by approximately 3.46 cm² 439 440.
23.11 Exercises illustrating regression analysis
The provided text includes several exercises that demonstrate the application of simple linear regression in various fields.
- Exercise 9.3.1: Involves plotting regression equations to determine if X and Y are directly (positively) or inversely (negatively) related, based on the sign of the slope.
- Exercise 9.3.2: Requires constructing a scatter diagram and then selecting the best-fitting regression equation among several options, justifying the choice 441.
- Exercise 9.3.3: Focuses on the relationship between methadone dose and the corrected QT (QTc) interval, where QTc is the dependent variable and methadone dose is the independent variable, typical for prediction and estimation. [441-442]
- Exercise 9.3.4: Compares two measurement techniques (point-of-care vs. standard laboratory assays for INR) using regression analysis, where one assay result is used to predict the other. [442-443]
- Exercise 9.3.5: Examines the effect of digoxin with grapefruit juice on peak plasma concentration (Cmax), using the Cmax with water as the independent variable to predict the percent change in Cmax with grapefruit juice.
- Exercise 9.3.6: Investigates the effect of velocity on ground reaction forces in dogs, implying a regression analysis to relate velocity to these forces 443.
24. Analysis of variance and regression analysis (part 8)
This section focuses on evaluating and utilizing simple linear regression equations by assessing the strength and significance of the relationship between two variables, and then using the established equation for prediction and estimation.
24.1 Evaluating the regression equation
After obtaining a regression equation, it is crucial to evaluate its effectiveness in describing the relationship between variables and its utility for prediction. This involves testing the significance of the slope (b1) and quantifying the strength of the relationship.
24.2 Hypothesis testing for the slope (b1)
The core of evaluating a regression equation lies in testing the null hypothesis that the population slope (b1) is zero.
- When H0:b1=0 is not rejected: This suggests that either the linear relationship between X and Y is not strong enough for X to be valuable in predicting Y, or that the relationship is not linear and a curvilinear model would be a better fit.
- When H0:b1=0 is rejected: This indicates that the linear relationship is sufficiently strong for predictive purposes, or that a linear model fits well but a curvilinear model might fit even better.
We can test H0:b1=0 using either the F statistic (through analysis of variance) or the t statistic.
24.3 The coefficient of determination (r2)
The coefficient of determination (r2) is an objective measure of the strength of the regression equation. It quantifies the proportion of the total variation in the observed Y values that is explained by the linear relationship with X.
- Total Deviation: The vertical distance of an observed value (yi) from the mean of Y (yˉ), denoted as yi−yˉ.
- Explained Deviation: The vertical distance between the predicted value (y^i) and the mean of Y (yˉ), denoted as y^i−yˉ. This represents the reduction in total deviation achieved by using the regression line.
- Unexplained Deviation (Residual): The vertical distance of an observed value (yi) from the regression line (y^i), denoted as yi−y^i. This is the portion of the total deviation not accounted for by the regression.
These deviations lead to sums of squares:
- Total Sum of Squares (SST): Measures the total variation in observed Y values. SST=∑(yi−yˉ)2
- Explained Sum of Squares (SSR): Measures the variability in Y explained by the linear relationship with X. Also known as the sum of squares due to linear regression. SSR=∑(y^i−yˉ)2
- Unexplained Sum of Squares (SSE): Measures the variability in Y not explained by the regression, also known as the error sum of squares or residual sum of squares. This is minimized in the least-squares line. SSE=∑(yi−y^i)2
The relationship between these sums of squares is: SST=SSR+SSE
The sample coefficient of determination is calculated as: r2=SSTSSR=∑(yi−yˉ)2∑(y^i−yˉ)2
- r2 ranges from 0 to 1.
- A large r2 indicates that a substantial proportion of the variability in Y is explained by X, suggesting a good fit of the regression line.
- r2=1 means all observations fall on the regression line.
- r2=0 means the regression line and the line through yˉ coincide, with no variation in Y explained by X.
Note: The coefficient of determination provides a point estimate of the population coefficient of determination. An unbiased estimator, r~2, can be calculated using mean squares, which is particularly relevant when the number of degrees of freedom is small. r~2=1−SST/(n−1)SSE/(n−2)
24.4 Testing H0:b1=0 with the F statistic
The F statistic is derived from the analysis of variance (ANOVA) table. It compares the variance explained by the regression to the unexplained variance (error).
The ANOVA table typically includes:
When H0:b1=0 is true and the regression assumptions are met, the ratio MSR/MSE follows an F-distribution with 1 and n−2 degrees of freedom.
Example: In Example 9.4.1, an F-statistic of 217.28 was computed, leading to the rejection of H0:b1=0 at α=0.05.
24.5 Testing H0:b1=0 with the t statistic
An alternative method to test H0:b1=0 uses the t statistic. This is particularly useful when estimating or testing hypotheses about the intercept (b0) as well.
- The sampling distribution of b^1 (the sample estimate of b1) is normal with mean b1 and variance sb^12=∑(xi−xˉ)2sy∣x2.
- When sy∣x2 (the unexplained variance) is unknown, it is estimated by MSE.
- The test statistic is: t=sb^1b^1−b1. where b1 is the hypothesized value of b1. Typically, b1=0. sb^1 is the estimated standard error of b^1 .
- This statistic follows a t-distribution with n−2 degrees of freedom.
Note: The square of the t-statistic is equal to the F-statistic (t2=F), meaning both tests will lead to the same conclusion regarding the null hypothesis.
Example: In Example 9.4.2, a t-statistic of 14.74 was calculated, leading to the rejection of H0:b1=0 at α=0.05.
24.6 Confidence interval for b1
A confidence interval for b1 provides a range of plausible values for the population slope. The general formula is: Estimator±(Reliability Factor)×(Standard Error of Estimator) For b1, this becomes: b^1±tα/2,n−2sb^1 where sb^1=∑(xi−xˉ)2MSE.
Important: A confidence interval for b1 can also be used to test H0:b1=0. If the interval includes zero, the null hypothesis is not rejected; if zero is outside the interval, the null hypothesis is rejected.
Example: A 95 percent confidence interval for b1 was calculated as (2.99, 3.92), which does not include zero, supporting the rejection of H0:b1=0.
24.7 Testing the regression assumptions
Residual plots are essential for assessing the validity of the linearity and equal-variances assumptions of the regression model.
- Residual plot: Plotting residuals (yi−y^i) against predicted values (y^i).
- A random scatter of points above and below the horizontal line at 0 suggests the assumptions are met.
- A non-random pattern (e.g., a curve) indicates a potential violation of the linearity assumption.
- A funnel shape (widening or narrowing scatter) indicates a potential violation of the equal-variances (homoscedasticity) assumption.
Example: In Example 9.4.3, while the random scatter supported linearity, a funneling tendency suggested unequal variances.
24.8 Using the regression equation
If the evaluation indicates a significant relationship, the regression equation can be used for prediction and estimation.
24.9 Predicting Y for a given X
The regression equation can be used to predict a specific Y value for a given X value. A prediction interval provides a range within which an individual Y value is likely to fall.
- Prediction Interval for Y: y^±tα/2,n−2sy∣x1+n1+∑(xi−xˉ)2(xp−xˉ)2 where xp is the specific value of X for prediction.
24.10 Estimating the mean of Y for a given X
The regression equation can also estimate the mean of the subpopulation of Y values at a specific X value. A confidence interval for this mean provides a range of plausible values for the population mean of Y.
- Confidence Interval for the Mean of Y: y^±tα/2,n−2sy∣xn1+∑(xi−xˉ)2(xp−xˉ)2
Important: The prediction interval for an individual Y value is always wider than the confidence interval for the mean of Y at the same X value because it accounts for both the uncertainty in estimating the regression line and the inherent variability of individual data points.
Example: Using MINITAB, for a waist circumference of 100 cm, a 95 percent confidence interval for AT area was (122.58, 137.23) dollars, while the 95 percent prediction interval was (63.93, 195.87) dollars.
This section delves into advanced aspects of regression analysis, including the interpretation of confidence and prediction intervals, the handling of unusual observations through resistant lines, and the distinction between the classic regression model and the correlation model.
24.11 Interpreting and utilizing regression results
The interpretation of confidence intervals (C.I.) and prediction intervals (P.I.) is crucial for understanding the uncertainty associated with regression estimates.
- Confidence Interval (C.I.): A 95 percent confidence interval for the mean response (e.g., mean amount of deep abdominal AT for a specific waist circumference) provides a range within which we are 95 percent confident the true population mean lies. If repeated samples were drawn and intervals constructed, approximately 95 percent of these intervals would contain the population mean. For example, a 95 percent C.I. of 122.58 to 137.23 suggests high confidence that the population mean deep abdominal AT for men with a waist circumference of 100 cm falls within this range.
- Prediction Interval (P.I.): A 95 percent prediction interval estimates the range for a single future observation (e.g., the deep abdominal AT value for an individual man with a waist circumference of 100 cm). This interval is wider than a confidence interval because it accounts for both the uncertainty in the mean response and the variability of individual data points around the regression line. A 95 percent P.I. of 63.93 to 195.87 square centimeters indicates that we are 95 percent confident that an individual man with a 100 cm waist circumference will have a deep abdominal AT area within this broader range.
Simultaneous confidence and prediction intervals can be plotted to visualize the uncertainty across the entire range of the fitted regression line. These intervals are narrowest at the mean data point (middle of the line) and widen towards the ends. This highlights the importance of interpolation (estimation within the bounds of the data) over extrapolation (estimation outside the bounds), as extrapolation carries a significantly higher risk of prediction error.
Note: Figure 9.5.1 visually represents simultaneous confidence and prediction intervals, illustrating how their width varies along the regression line 460.
24.12 Handling unusual observations with resistant lines
The standard least-squares regression method is sensitive to unusual observations (outliers), which can disproportionately influence the fitted line. A resistant line method, notably developed by John W. Tukey, offers a more robust approach to fitting a line to data that may contain such observations 461.
- Least-squares method's sensitivity: Unusual observations in either the independent variable (X) or the dependent variable (Y) can substantially alter the position and slope of the least-squares regression line, leading to a lack of resistance.
- Resistant line methodology: This exploratory data analysis technique uses medians, which are inherently resistant to extreme values. The data is partitioned into three nearly equal groups based on the independent variable: the smallest, the largest, and the middle values. The resistant line is fitted such that an equal number of points lie above and below the line within both the smallest and largest groups [461-462]
- Benefits of resistant lines: The resulting slope and intercept estimates are less affected by extreme X or Y values, providing a more reliable representation of the underlying linear trend.
- Half-slope ratio: This metric indicates the degree of linearity. It is calculated as the ratio of the slope of the line fitted to the upper half of the data to the slope of the line fitted to the lower half. A ratio close to 1 suggests good linearity; a ratio far from 1 indicates a lack of linearity.
Example: Figure 9.5.3 illustrates the MINITAB procedure for fitting a resistant line, showing its slope, intercept, and half-slope ratio 462.
24.13 The correlation model versus the classic regression model
A fundamental distinction exists between the classic regression model and the correlation model, primarily concerning the nature of the variables involved.
| Feature | Classic Regression Model | Correlation Model |
|---|---|---|
| Dependent Variable (Y) | Random | Random |
| Independent Variable (X) | Fixed (nonrandom, mathematical) | Random |
| Data Collection | Often involves preselecting X values and observing Y. | Involves selecting a random sample of units of association and measuring both X and Y. |
| Objective | Prediction and estimation of Y based on X. | Measuring the strength and nature of the co-relationship between X and Y. |
| Distinction | Explicitly distinguishes between dependent and independent variables. | Treats X and Y on an equal footing; no designation of dependent or independent. |
- Regression analysis under correlation: Regression analysis can still be performed under the correlation model. If the goal is prediction or estimation, the variable for which predictions are desired should be designated as the dependent variable and regressed on the other.
- Correlation analysis: Correlation analysis focuses on the co-relationship between variables, implying they are on equal footing without one being designated as dependent or independent. While computational procedures for fitting a line are similar, the interpretation differs. Regression of X on Y and Y on X will generally yield different fitted lines.
24.14 Assumptions of the correlation model
For inferential procedures to be valid when sampling from a bivariate distribution, several assumptions must be met.
- Normality of Y subpopulations: For each specific value of X, the subpopulation of Y values must be normally distributed.
- Normality of X subpopulations: For each specific value of Y, the subpopulation of X values must be normally distributed.
- Bivariate normal distribution: The joint distribution of X and Y must be a normal distribution, known as the bivariate normal distribution.
If these assumptions are not met, inferential procedures become invalid, although descriptive measures of correlation can still be computed.
Important: The classic regression model assumes only Y is random, whereas the correlation model assumes both X and Y are random variables, often described by a bivariate normal distribution 463.
25. Analysis of variance and regression analysis (part 9)
This section focuses on correlation analysis, detailing its purpose, calculation, hypothesis testing, and interpretation, especially within the context of linear relationships between variables.
25.1 The correlation coefficient
The correlation coefficient quantifies the strength and direction of a linear relationship between two variables.
- Population Correlation Coefficient (r): This parameter describes the linear relationship in the entire population. It is the square root of the population coefficient of determination (r2), meaning it can range from -1 (perfect inverse linear correlation) to +1 (perfect direct linear correlation). A value of 0 indicates no linear correlation. The sign of r is the same as the sign of the slope (b1) of the population regression line.
- Sample Correlation Coefficient (r): This statistic is an estimate of the population correlation coefficient, calculated from sample data. It serves the same purpose as r but describes the relationship within the sample. The sample correlation coefficient is the square root of the sample coefficient of determination.
Note: When testing for a linear correlation, the primary hypothesis is H0:r=0 against HA:r=0 465.
25.1.1 Calculating the sample correlation coefficient
The sample correlation coefficient (r) can be calculated using several formulas. One method involves the estimates of the regression slope and sums of squares:
r=∑i=1nyi2−n(∑i=1nyi)2b^12∑i=1nxi2−∑i=1nxi(∑i=1nxi)2 468.
An alternative formula, which is advantageous when the regression equation is not needed, directly uses sums of products and squares:
r=n∑xi2−(∑xi)2n∑yi2−(∑yi)2n∑xiyi−(∑xi)(∑yi) 480.
Tip: The sample correlation coefficient (r) will always have the same sign as the sample slope (b^1).
25.1.2 Hypothesis testing for the population correlation coefficient
Testing hypotheses about the population correlation coefficient (r) is crucial to determine if an observed sample correlation is statistically significant.
Testing H0:r=0: When the null hypothesis is H0:r=0, a t-test statistic can be used: t=1−r2rn−2 470. Under the null hypothesis and given the assumptions are met, this test statistic follows a t-distribution with n−2 degrees of freedom. The calculated t-statistic is compared to critical values.
Important: The test statistic for the correlation coefficient (t=r1−r2n−2) is equivalent to the test statistic for the slope of the regression line. Squaring this t-statistic yields the F-statistic used in the analysis of variance for regression.
Testing H0:r=r0 (where r0=0): For hypotheses where the hypothesized population correlation coefficient (r0) is not zero, Fisher's Z-transformation is typically used. This transformation converts r into a variable zr that is approximately normally distributed.
-
Fisher's Z-transformation: zr=21ln(1−r1+r) The mean of zr is zr0=21ln(1−r01+r0), and its estimated standard deviation is: szr=n−31
-
Test Statistic: Z=szrzr−zr0=1/n−3zr−zr0=(zr−zr0)n−3 471. This Z statistic approximately follows the standard normal distribution. Tables (like Appendix Table I) can be used to find zr values for given r values, simplifying calculations.
Caution: Fisher's Z-transformation should be used with care for sample sizes less than 25. An alternative procedure by Hotelling may be used for sample sizes of 10 or greater, employing a slightly different transformation (z3′) and standard error 472.
25.1.3 Confidence Interval for r
Confidence intervals for the population correlation coefficient (r) can be constructed using Fisher's Z-transformation. The process involves:
- Transforming the sample correlation coefficient (r) to zr.
- Constructing a confidence interval for zr using the standard normal distribution: zr±zα/2⋅szr=zr±zα/2n−31 473 481.
- Reconverting the lower and upper limits of this interval back to r values using inverse Z-transformation (e.g., by interpolating in Appendix Table I).
25.2 Precautions in regression and correlation analysis
Regression and correlation analyses are powerful tools but require careful application to avoid misinterpretation.
- Assumptions: Always review the assumptions underlying the models (e.g., linearity, independence of errors, constant variance of errors) before data collection. Understand the gap between the data and the assumptions to decide on the analysis strategy.
- Unit of Association: In simple linear regression and correlation, variables are measured on the same entity (the "unit of association"). Ensure measurements are taken on the same individuals or units to avoid nonsensical correlations.
- Correlation vs. Causation: A strong correlation between two variables (X and Y) does not imply causation. The observed relationship could be due to:
- X causing Y.
- Y causing X.
- A third factor influencing both X and Y.
- Chance occurrence in the sample.
- A nonsensical correlation due to improper units of association.
- Extrapolation: Do not use a sample regression equation to predict or estimate values outside the range of the independent variable observed in the sample. This practice, known as extrapolation, is risky because the linear relationship may not hold beyond the sampled interval, potentially leading to false conclusions. 478 482.
Remember: Always consider potential confounding variables or alternative explanations when interpreting correlation results 477.
26. Analysis of variance and regression analysis (part 10)
This section focuses on understanding and modeling relationships between variables using regression and correlation analysis, alongside key concepts from Analysis of Variance (ANOVA) that are foundational to regression model interpretation.
26.1 Understanding simple linear regression
Simple linear regression is a statistical method used to model the linear relationship between a dependent variable (Y) and a single independent variable (X). The goal is to find the line that best fits the observed data, allowing for prediction and understanding the strength and direction of the association.
26.2 The regression model and its components
The core of simple linear regression is the model: Y=β0+β1X+ϵ where:
- Y is the dependent variable.
- X is the independent variable.
- β0 is the population intercept, representing the expected value of Y when X=0.
- β1 is the population slope, representing the expected change in Y for a one-unit increase in X.
- ϵ is the random error term, accounting for variability in Y not explained by X.
The estimated regression equation, based on sample data, is: Y^=β^0+β^1X where Y^ is the predicted value of Y, and β^0 and β^1 are the estimated intercept and slope, respectively.
26.3 Estimating regression coefficients
The most common method for estimating β^0 and β^1 is the method of least squares. This method minimizes the sum of the squared differences between the observed values of Y and the predicted values Y^. The formulas for the estimated coefficients are: β^1=∑i=1n(Xi−Xˉ)2∑i=1n(Xi−Xˉ)(Yi−Yˉ)=SXXSXY β^0=Yˉ−β^1Xˉ
- n is the number of observations.
- Xi and Yi are the observed values of the independent and dependent variables for the i-th observation.
- Xˉ and Yˉ are the means of the independent and dependent variables.
- SXY=∑i=1n(Xi−Xˉ)(Yi−Yˉ) is the sum of cross-products.
- SXX=∑i=1n(Xi−Xˉ)2 is the sum of squares for X.
Example: For estimating the relationship between dosage and concentration, the regression equation can be computed to predict concentration based on dosage.
26.4 Assessing the fit of the regression model
Several metrics are used to evaluate how well the regression model fits the data:
- Coefficient of determination (R2): This value represents the proportion of the total variation in the dependent variable (Y) that is explained by the independent variable (X). It is calculated as R2=SSTSSR, where SSR is the sum of squares due to regression and SST is the total sum of squares. A higher R2 indicates a better fit.
- Standard error of the estimate (se): This measures the typical distance between the observed values of Y and the regression line. It is calculated as se=n−2SSE, where SSE is the sum of squared errors (residuals).
26.5 Correlation analysis
Correlation analysis quantifies the strength and direction of the linear relationship between two variables. While regression analysis aims to predict one variable from another, correlation analysis focuses solely on the association.
26.6 The Pearson correlation coefficient (r)
The Pearson correlation coefficient (r) measures the linear association between two continuous variables. Its value ranges from -1 to +1:
- r=+1: Perfect positive linear correlation.
- r=−1: Perfect negative linear correlation.
- r=0: No linear correlation.
The formula for r is: r=SXXSYYSXY where SYY=∑i=1n(Yi−Yˉ)2.
The coefficient of determination (R2) from simple linear regression is equal to the square of the Pearson correlation coefficient (r2) when there is only one predictor variable.
Note: Correlation does not imply causation. A strong correlation between two variables does not mean that one causes the other; there might be a confounding variable or the relationship could be coincidental.
26.7 Hypothesis testing in regression and correlation
Hypothesis tests are crucial for determining whether the observed relationships in the sample data are statistically significant or likely due to random chance.
26.8 Testing the slope coefficient (β1)
A common hypothesis test is to assess if the population slope (β1) is significantly different from zero, which would indicate a linear relationship between X and Y.
- Null hypothesis (H0): β1=0 (no linear relationship).
- Alternative hypothesis (HA): β1=0 (there is a linear relationship).
This hypothesis can be tested using a t-test: t=sβ^1β^1−β1,H0 where sβ^1 is the standard error of the estimated slope. The test statistic follows a t-distribution with n−2 degrees of freedom.
The same hypothesis can also be tested using an F-test, which is related to the R2 value in simple linear regression. The F-statistic is calculated as: F=MSEMSR=SSE/(n−2)SSR/1 where MSR is the mean square due to regression and MSE is the mean square due to error. The F-statistic follows an F-distribution with 1 and n−2 degrees of freedom. In simple linear regression, F=t2.
Example: The F-test and t-test are used to assess if the null hypothesis H0:β1=0 can be rejected 486.
26.9 Testing the correlation coefficient (ρ)
Similarly, we can test if the population correlation coefficient (ρ) is significantly different from zero.
- Null hypothesis (H0): ρ=0 (no linear correlation).
- Alternative hypothesis (HA): ρ=0 (there is a linear correlation).
This test also uses a t-statistic: t=r1−r2n−2 This t-statistic follows a t-distribution with n−2 degrees of freedom.
Example: The correlation coefficient r is computed, and the null hypothesis H0:r=0 is tested.
26.10 Prediction and confidence intervals
Regression analysis is frequently used for prediction.
26.11 Confidence interval for the mean response
A confidence interval for the mean response provides a range of plausible values for the average value of Y for a given value of X. This interval is generally narrower than a prediction interval.
26.12 Prediction interval for an individual response
A prediction interval provides a range of plausible values for an individual observation of Y for a given value of X. This interval is always wider than a confidence interval for the mean response at the same confidence level because it accounts for both the uncertainty in estimating the regression line and the inherent variability of individual data points.
Example: A 95 percent prediction interval is constructed for the glucose level of a man weighing 95 kg and for the temperature at 50 hours after inoculation488.
26.13 Examples of regression and correlation in practice
The provided document presents numerous examples illustrating the application of regression and correlation analysis across various scientific and medical fields. These include:
- Medical Studies: Analyzing relationships between treatment outcomes and patient characteristics (e.g., age, hyperactivity scores ), drug dosages and concentrations and physiological measurements like blood pressure and age 487 497.
- Health Care: Predicting repackaging time for medications based on the number of problems encountered 485.
- Physiology and Biology: Investigating correlations between hormonal levels and physiological parameters blood mercury levels and intake and immune markers and disease states 491 493.
- Psychology and Neuroscience: Examining relationships between physiological signals like heart rate variability and psychological tasks 498.
These examples highlight the versatility of regression and correlation in drawing conclusions, making predictions, and understanding complex relationships within data.
This section focuses on the practical application and interpretation of statistical analyses, particularly regression, using provided datasets to explore relationships between variables.
26.14 Introduction to regression analysis and correlation
Regression analysis is a statistical technique used to model and analyze the relationship between a dependent variable and one or more independent variables. Correlation, closely related, measures the strength and direction of the linear association between two variables. This part of the study guide uses real-world data to illustrate these concepts and their application.
Important: The provided data sets serve as practical examples for applying statistical methods, allowing for hands-on analysis of observed relationships.
26.15 Case study: Fleroxacin disposition factors
This section examines a study investigating factors influencing the disposition of fleroxacin, a fluoroquinolone antibiotic. The primary goal was to estimate key pharmacokinetic parameters like clearance over systemic availability (CL/F) and volume of distribution over systemic availability (V/F), and to quantify the influence of other factors on these parameters.
- Study Objective: To estimate typical values of CL/F and V/F for fleroxacin and identify factors affecting its disposition.
- Subjects: 172 healthy male and female volunteers and uninfected patients across a wide age range.
- Key Data Points: Measurements of CL/F and creatinine clearance (CLcr) were collected, with previous studies indicating a correlation between these two variables.
Note: The correlation between CL/F and CLcr suggests that renal function, as measured by creatinine clearance, might be a significant factor influencing the elimination of fleroxacin from the body 501.
26.16 Case study: Percutaneous transvenous mitral commissurotomy (PTMC) effects
This part of the study guide presents data from a study by Yasu et al. using noninvasive magnetic resonance spectroscopy to assess the impact of percutaneous transvenous mitral commissurotomy (PTMC) on skeletal muscle responses during exercise.
- Study Aim: To determine short- and long-term effects of PTMC on exercise capacity and metabolic responses of skeletal muscles.
- Participants: 11 patients (2 males, 9 females) with symptomatic mitral stenosis, with a mean age of 52 years (standard deviation of 11).
- Data Collected: Changes in mitral valve area (d-MV A) and peak oxygen consumption (d-Vo2) were measured at 3, 30, and 90 days post-PTMC.
Example: The data table shows measurements of d-MV A and d-Vo2 for each subject at different time points post-PTMC, allowing for the analysis of how the intervention affects physiological parameters over time 502.
26.17 Exercise prompt: Cerebral edema and glycerol treatment
An exercise is proposed that involves analyzing data for 1050 subjects with cerebral edema. The focus is on understanding the relationship between intracranial pressure and glycerol plasma concentration, a key aspect for clinicians treating this condition.
- Problem: Cerebral edema can lead to increased intracranial pressure, and various treatments exist with varying effectiveness and side effects.
- Treatment Example: Glycerol, administered orally or intravenously, is one such treatment.
- Investigative Focus: The relationship between intracranial pressure and glycerol plasma concentration is of clinical interest.
- Task: Select a simple random sample from the data, perform a useful analysis, and present findings with appropriate graphs, comparing results with peers.
Tip: This exercise encourages the application of statistical consulting skills, emphasizing the importance of selecting appropriate analytical methods and presenting findings clearly for research teams 503.
27. Analysis of variance and regression analysis (part 11)
This section focuses on the principles and application of multiple regression and correlation, extending the concepts of simple linear regression to situations involving more than two variables.
27.1 Introduction to multiple regression and correlation
In simple linear regression, we examine the relationship between two variables. However, in many real-world scenarios, a dependent variable is influenced by multiple independent variables. Multiple regression and correlation techniques allow us to simultaneously analyze the relationships among several variables, thereby improving prediction accuracy and providing a more comprehensive understanding of complex phenomena. This chapter builds upon the foundations of simple linear regression and bivariate correlation by introducing methods for handling multiple independent variables 507.
Note: Multiple regression is particularly useful when researchers want to explain the variation in a dependent variable by considering the combined effects of several independent variables. This can lead to more robust predictive models and a deeper understanding of the underlying processes 508.
27.2 The multiple linear regression model
The multiple linear regression model assumes a linear relationship between a dependent variable (Y) and k independent variables (X1,X2,…,Xk). The independent variables are often termed "explanatory variables" or "predictor variables" due to their role in explaining and predicting Y.
27.3 Assumptions of multiple regression
The assumptions underlying multiple regression analysis are crucial for valid inference:
- Nonrandom independent variables: The independent variables (Xi) are considered fixed (nonrandom). This means inferences apply only to the observed set of X values. This differentiates it from the multiple correlation model where X variables can also be random.
- Normality of subpopulations of Y: For each combination of Xi values, the corresponding subpopulation of Y values is assumed to be normally distributed. This assumption is necessary for constructing confidence intervals and testing hypotheses.
- Equal variances: The variances of the subpopulations of Y are assumed to be equal (homoscedasticity).
- Independence of Y values: The Y values selected for one set of X values are independent of the Y values selected at another set of X values.
27.4 The model equation
The multiple linear regression model can be expressed as: yj=β0+β1x1j+β2x2j+⋯+βkxkj+ϵj (10.2.1) where:
- yj is a typical value from a subpopulation of Y values.
- β0,β1,…,βk are the regression coefficients.
- x1j,x2j,…,xkj are particular values of the independent variables X1,X2,…,Xk.
- ϵj is a random error term with a mean of 0 and a common variance σ2.
When there are two independent variables, the model is: yj=β0+β1x1j+β2x2j+ϵj (10.2.2) Geometrically, this represents a plane in three-dimensional space. With more than two independent variables, it represents a hyperplane 509.
The deviation of an observed point from the regression plane is represented by the error term: ϵj=yj−(β0+β1x1j+β2x2j) (10.2.3)
- β0 is the Y-intercept, representing the value of Y when all independent variables are zero.
- β1 is a partial regression coefficient, measuring the average change in Y for a unit change in X1, holding X2 constant.
- β2 is a partial regression coefficient, measuring the average change in Y for a unit change in X2, holding X1 constant 510.
27.5 Obtaining the multiple regression equation
Estimates of the regression coefficients (β0,β1,…,βk) are obtained using the method of least squares. This method minimizes the sum of the squared deviations of the observed Y values from the regression surface.
The quantity to be minimized is the sum of squares of the residuals: ∑ej2=∑(yj−y^j)2=∑(yj−(β^0+β^1x1j+⋯+β^kxkj))2 (10.3.1) where β^i are the estimated coefficients and y^j are the predicted values of Y.
Important: While manual calculation of multiple regression coefficients is possible, it is tedious, error-prone, and impractical with modern computing power. Statistical software packages like SPSS, MINITAB, and SAS are commonly used for these analyses 511.
27.6 Example: predicting attentional capacity
Researchers Jansen and Keller studied the relationship between age and education level (independent variables) and the capacity to direct attention (CDA, dependent variable) in 71 elderly women. CDA measures neural inhibitory mechanisms that focus attention.
-
Data Visualization: Before formal analysis, creating scatter plots for each pair of variables (e.g., CDA vs. Age, CDA vs. Education Level, Age vs. Education Level) is beneficial. This can reveal preliminary relationships, such as a potential negative relationship between CDA and age, and a positive relationship between CDA and education level. A matrix scatter plot, as produced by SPSS, can display all pairwise relationships simultaneously 512.
-
Software Application (MINITAB and SAS): Using statistical software, the sample multiple regression equation can be obtained. For Example 10.3.1, the MINITAB output yielded the equation: y^j=5.49−0.184x1j+0.611x2j where X1 is age and X2 is education level. The SAS output provides similar parameter estimates, standard errors, and p-values for the coefficients.
Example: In Example 10.3.1, the estimated regression equation was y^=5.49−0.184Age+0.611Education Level. This suggests that for every year increase in age, the CDA score is predicted to decrease by 0.184, holding education level constant. Conversely, for every year of increased education, the CDA score is predicted to increase by 0.611, holding age constant 514.
27.7 Exercises
The exercises provide practice in obtaining multiple regression equations using various datasets and research contexts:
- Exercise 10.3.1: Predict maximum mouth opening (MMO) using mandibular length (ML) and angle of rotation (RA) 515.
- Exercise 10.3.2: Predict caregiver burden (KBI) using activities of daily living (ADL), memory and behavioral problems (MEM), and cognitive impairment (COG) 515-516.
- Exercise 10.3.3: Predict hospital admission rates using the index of availability of other health services and the index of indigency 517.
- Exercise 10.3.4: Predict the postoperative length of stay in days using the number of current medical problems and the preoperative length of stay 517-518.
- Exercise 10.3.5: Predict state board examination scores using final school scores and aptitude test scores 518.
- Exercise 10.3.6: Predict mean arterial blood pressure using age, weight, body surface area, duration of hypertension, basal pulse beat, and a measure of stress.
27.8 Evaluating the multiple regression equation
Before using a multiple regression equation for prediction or estimation, it is essential to evaluate its usefulness. Key measures for evaluation include the coefficient of multiple determination and the partial regression coefficients 519.
This section focuses on evaluating and interpreting multiple regression models, specifically by partitioning the total variation in the dependent variable and testing hypotheses about the overall model and individual predictors.
27.9 Partitioning variation in multiple regression
In multiple regression, the total variation in the dependent variable (Y) can be divided into two components: explained variation and unexplained variation. This partitioning is fundamental to assessing the model's performance.
-
Total Sum of Squares (SST): This represents the total variation in the observed Y values from their mean. It is calculated as the sum of squared deviations of each Y observation from the overall mean of Y. SST=∑i=1n(yi−yˉ)2 This is also denoted as ∑yj/C0/C22y/C0/C122.
-
Sum of Squares due to Regression (SSR): This measures the variation in Y that is explained by the fitted regression surface. It is calculated as the sum of squared deviations of the predicted Y values (y^) from the mean of the observed Y values (yˉ). SSR=∑i=1n(y^i−yˉ)2 This is also denoted as ∑y^j/C0/C22y/C0/C122.
-
Sum of Squares about Regression (SSE) or Error Sum of Squares: This represents the unexplained variation in Y, meaning the part of the total variation not accounted for by the regression model. It is calculated as the sum of squared deviations of the observed Y values from their predicted values (y^). SSE=∑i=1n(yi−y^i)2 This is also denoted as ∑yj/C0jy/C0/C122.
The relationship among these three sums of squares is given by: SST=SSR+SSE This equation signifies that the total variation is equal to the sum of the explained and unexplained variations.
27.10 Coefficient of Multiple Determination (R2)
The coefficient of multiple determination, denoted as Ry:12...k2, quantifies the proportion of the total variation in the dependent variable Y that is explained by the independent variables X1,X2,…,Xk.
Ry:12...k2=SSTSSR
- The subscript y:12...k indicates that Y is the dependent variable and X1 through Xk are the independent variables.
- R2 is a measure of the goodness of fit of the regression surface, analogous to r2 in simple linear regression. Its value ranges from 0 to 1.
Example: If Ry:122=0.371, it means that approximately 37.1 percent of the total variation in Y values is explained by the linear relationship with the independent variables X1 and X2 520.
27.11 Testing the overall regression hypothesis
A hypothesis test is performed to determine if the overall multiple regression model is statistically significant, meaning if the independent variables as a group explain a significant portion of the variation in the dependent variable.
-
Hypotheses:
- Null Hypothesis (H0): All partial regression coefficients are zero (β1=β2=⋯=βk=0). This implies the independent variables have no value in explaining the variation in Y.
- Alternative Hypothesis (HA): Not all βi are zero. This implies at least one independent variable is linearly related to Y.
-
Test Statistic: The test statistic is the V.R. (Variance Ratio), which is calculated as part of an analysis of variance (ANOVA) for regression.
-
ANOVA Table for Multiple Regression:
- n is the sample size.
- k is the number of independent variables.
- MSR is the mean square due to regression.
- MSE is the mean square about regression (error mean square).
-
Distribution of Test Statistic: If H0 is true and the model assumptions are met, V.R. follows an F-distribution with k numerator degrees of freedom and n−k−1 denominator degrees of freedom.
-
Decision Rule: Reject H0 if the computed V.R. value is greater than or equal to the critical F-value for the chosen significance level (α).
-
Conclusion: If H0 is rejected, it is concluded that the dependent variable is linearly related to the independent variables as a group in the population. If H0 is not rejected, there may be no significant linear relationship between the dependent variable and the independent variables collectively. [521-522]
Example: Testing if CDA score is linearly related to age and education level. The null hypothesis is H0:β1=β2=0. With a significance level of α=0.01, the decision rule is to reject H0 if the computed V.R. is ≥4.95. If the computed V.R. is 20.02, H0 is rejected, indicating a significant linear relationship 522.
27.12 Inferences regarding individual partial regression coefficients (βi)
It is often necessary to assess the individual contribution of each independent variable to the prediction of the dependent variable, while controlling for other variables in the model.
-
Hypothesis Tests for βi: To test the null hypothesis that a specific partial regression coefficient βi is equal to a particular value (typically 0), the following t-statistic is computed: t=sβ^iβ^i−βi0
- β^i is the estimated partial regression coefficient for the i-th independent variable.
- βi0 is the hypothesized value of βi (usually 0).
- sβ^i is the standard deviation of β^i.
-
Degrees of Freedom: The degrees of freedom for this t-test are n−k−1, the same as the denominator degrees of freedom in the overall F-test.
-
Standard Deviations of β^i: The standard deviations of the estimated coefficients (sβ^i) are typically provided as part of the output from statistical software packages that perform regression analysis.
Example: To test if age (β1) is irrelevant in predicting CDA score, the hypotheses are H0:β1=0 and HA:β1=0 at α=0.05. If the computed t-statistic is −3.80, and the critical t-values are ±1.9957, H0 is rejected because −3.80<−1.9957. This suggests a significant linear relationship between age and CDA score, even when education level is in the model.
- Test for β2: A similar test can be performed for β2. If β^2=0.6108 and sβ^2=0.1357, the computed t-statistic is t=0.13570.6108−0=4.50. This value would likely lead to the rejection of H0:β2=0, indicating a significant contribution of education level 523.
28. Analysis of variance and regression analysis (part 12)
This section focuses on the application and interpretation of multiple regression and correlation analysis, including constructing confidence and prediction intervals and understanding the nuances of multiple correlation coefficients and partial correlations.
28.1 Using the multiple regression equation
A multiple regression equation, y^j=β^0+β^1x1j+β^2x2j+⋯+β^kxkj, can be used to obtain a computed value of Y, denoted as y^, for given values of the independent variables X1,X2,…,Xk. This y^ value can be interpreted in two ways: as an estimate of the mean of the subpopulation of Y values for specific combinations of Xi values (estimating equation), or as the most likely value Y will assume for given Xi values (prediction equation).
28.2 Confidence intervals for the mean of Y
A confidence interval for the mean of Y, given specified values of the Xi variables, is constructed by adding to and subtracting from the estimator y^j a quantity equal to the reliability factor multiplied by the standard error of the estimator (s^y^j). The formula for a 100(1−α) percent confidence interval is:
y^j±t1−α/2,n−k−1sy^j
Note: The calculation of sy^j in the multiple regression case can be complex.
28.3 Prediction intervals for a particular value of Y
A prediction interval for a particular value of Y, given specified values of the Xi variables, is constructed similarly to a confidence interval, but uses a slightly larger standard error (sy^j0). This results in a wider interval compared to the confidence interval for the mean. The formula for a 100(1−α) percent prediction interval is:
y^j±t1−α/2,n−k−1sy^j0
Reminder: The prediction interval is always wider than the confidence interval because it is more difficult to estimate an individual observation's value than the mean response 526 527.
28.4 The multiple correlation model
The multiple correlation model is concerned with measuring the strength of the linear relationship among several variables. Unlike the multiple regression model where Xi are considered nonrandom, in the multiple correlation model, Xi are treated as random variables, implying a joint distribution of Y and the Xi (a multivariate distribution). This allows for interchangeable roles among variables 528.
28.5 The multiple correlation coefficient
The multiple correlation coefficient (Ry:12…k) is the square root of the coefficient of multiple determination (Ry:12…k2) and measures the strength of the linear relationship between Y and the set of independent variables X1,X2,…,Xk.
The sample value is computed as:
Ry:12…k=Ry:12…k2=SSTSSR
where SSR is the sum of squares for regression and SST is the total sum of squares 529.
Interpretation of the multiple correlation coefficient:
- It quantifies the strength of the linear relationship among the variables.
- It can be interpreted as the simple correlation coefficient between the observed values yj and the calculated values y^j.
- It is always given a positive sign.
Hypothesis testing for the multiple correlation coefficient:
The null hypothesis H0:ry:12…k=0 can be tested using an F-statistic, which is identical to the test for the significance of the regression coefficients:
F=1−Ry:12…k2Ry:12…k2kn−k−1
The computed F-value is compared with a tabulated value of F with k and n−k−1 degrees of freedom 531.
28.6 Partial correlation coefficients
Partial correlation coefficients measure the strength of the linear relationship between two variables after controlling for the effect of one or more other variables. For instance, ry1:2 measures the correlation between Y and X1 after removing the influence of X2.
Coefficient of partial determination:
The square of the partial correlation coefficient, ry1:22, represents the proportion of the remaining variability in Y that is explained by X1 after X2 has accounted for its share of the total variability in Y 532.
Calculation of partial correlation coefficients:
In a three-variable case (Y,X1,X2), with simple correlation coefficients ry1, ry2, and r12, the partial correlation coefficients are:
- Between Y and X1 after controlling for X2: ry1:2=(1−ry22)(1−r122)ry1−ry2r12
- Between Y and X2 after controlling for X1: ry2:1=(1−ry12)(1−r122)ry2−ry1r12
- Between X1 and X2 after controlling for Y: r12:y=(1−ry12)(1−ry22)r12−ry1ry2
Note: Partial correlation coefficients can be computed directly using statistical software by regressing variables on the control variables and then calculating the simple correlation between the residuals 533.
Hypothesis testing for partial correlation coefficients:
The null hypothesis that a population partial correlation coefficient is zero (H0:ry1:2…k=0) can be tested using a t-test:
t=ry1:2…k1−ry1:2…k2n−k−1
This statistic is distributed as a Student's t with n−k−1 degrees of freedom.
Example: Testing the hypothesis H0:ry1:2=0 with n=29, k=2, and ry1:2=0.102 yields t=0.523. With 26 degrees of freedom and α=0.05 (two-sided), this value is not significant, leading to a failure to reject H0.
Tip: Statistical software like SPSS can directly compute partial correlation coefficients and their associated p-values, simplifying the analysis 534.
This section of the study guide delves into the foundational concepts and formulas for multiple linear regression and correlation analysis, extending the principles of simple regression to situations involving multiple predictor variables.
28.7 Multiple linear regression and correlation
Multiple linear regression extends simple linear regression by allowing for more than one independent variable to predict a dependent variable. The goal is to find the best-fitting hyperplane that describes the relationship between the variables. Correlation analysis, in this context, quantifies the strength and direction of these relationships, including partial correlations that account for the influence of other variables.
28.8 The multiple linear regression equation
The general form of the multiple linear regression equation represents the dependent variable (yj) as a linear combination of k independent variables (x1j,x2j,…,xkj), plus an error term (ej). When there are two independent variables, the equation simplifies.
- General form: yj=β0+β1x1j+β2x2j+⋯+βkxkj+ej
- With two independent variables: yj=β0+β1x1j+β2x2j+ej
- Random deviation: The random deviation of an observed point from the regression plane (when there are two independent variables) is given by: ej=yj−y^j=yj−(β^0+β^1x1j+β^2x2j).
28.9 Measures of fit and significance
Key statistics are used to evaluate the overall fit of the multiple regression model and the significance of individual predictors.
- Sum-of-squared residuals (SSe): This measures the total variation in the dependent variable that is not explained by the regression model. ∑ej2=∑(yj−y^j)2.
- Sum-of-squares equation: This partitions the total variation in the dependent variable (SST) into the variation explained by the regression (SSR) and the unexplained variation (SSE). SST=SSR+SSE.
- Coefficient of multiple determination (R2): This represents the proportion of the total variation in the dependent variable that is explained by the independent variables in the model. It ranges from 0 to 1. Ry:12…k2=SSTSSR.
- t statistic for testing hypotheses about coefficients (bi): This statistic is used to test the significance of individual regression coefficients, assessing whether an independent variable has a statistically significant impact on the dependent variable, controlling for other variables in the model. t=sβ^iβ^i−βi0.
28.10 Estimation and prediction
Once the regression equation is established, it can be used for estimation and prediction.
- Estimated regression equation: This is the fitted model used to predict the dependent variable. y^j=β^0+β^1x1j+β^2x2j+⋯+β^kxkj.
- Confidence interval for the mean of Y: This provides a range of plausible values for the average value of the dependent variable for a given set of predictor variable values. y^j±t1−α/2,n−k−1sy^j.
- Prediction interval for Y: This provides a range of plausible values for an individual observation of the dependent variable for a given set of predictor variable values. y^j±t1−α/2,n−k−1s0y^j.
28.11 Multiple correlation coefficient and partial correlation
- Multiple correlation model: This is essentially the same as the multiple linear regression model, but viewed from the perspective of the correlation among variables. yj=β0+β1x1j+β2x2j+⋯+βkxkj+ej.
- Multiple correlation coefficient (R): This is the square root of the coefficient of multiple determination (R2) and indicates the strength of the linear relationship between the dependent variable and the set of independent variables. Ry:12…k=Ry:12…k2=SSTSSR.
- F statistic for testing the multiple correlation coefficient: This statistic is used to test the overall significance of the regression model, determining if at least one independent variable is related to the dependent variable. F=1−Ry:12…k2Ry:12…k2⋅kn−k−1.
- Partial correlation coefficient (r12:3): This measures the simple correlation between two variables (e.g., x1 and y) after controlling for the linear effects of one or more other variables (e.g., x3). r12:3=(1−r132)(1−r232)r12−r13r23 542.
- t statistic for testing hypotheses about partial correlation coefficients: This statistic is used to determine if a partial correlation coefficient is significantly different from zero. t=ry1:2…k1−ry1:2…k2n−k−1.
28.12 Key symbols in multiple regression and correlation
| Symbol | Meaning |
|---|---|
| β^x | Estimated regression/correlation coefficient for variable x |
| βx | Regression/correlation coefficient for variable x |
| e | Model error term |
| k | Number of independent variables |
| n | Sample size |
| r12.3 | Sample partial correlation coefficient between 1 and 2 after controlling for 3 |
| R | Sample multiple correlation coefficient |
| R2 | Multiple coefficient of determination |
| t | t statistic |
| xi | Value of independent variable at index i |
| xˉ | Sample mean of independent variable |
| yi | Value of dependent variable at index i |
| yˉ | Sample mean of dependent variable |
| y^ | Estimated y |
| z | z statistic |
Note: The assumptions underlying multiple regression and correlation analysis are critical for valid inference. These include linearity, independence of errors, homoscedasticity (constant variance of errors), and normality of errors. When these assumptions are violated, alternative methods may be necessary 541.
Example: A researcher might use multiple regression to predict a student's final exam score (y) based on their midterm exam score (x1), hours studied per week (x2), and attendance rate (x3). The R2 value would indicate the proportion of variance in exam scores explained by these predictors, and t-tests would assess the significance of each predictor 543.
29. Analysis of variance and regression analysis (part 13)
This section focuses on extending regression analysis by introducing techniques for handling qualitative independent variables, automated variable selection, and logistic regression, alongside a review of fundamental regression assumptions.
29.1 Introduction to additional regression techniques
The prior chapters have laid the groundwork for linear regression analysis, covering simple linear regression (prediction with one independent variable) and multiple linear regression (prediction with multiple independent variables). This section delves into more advanced topics to enhance the utility and scope of regression modeling, particularly for health sciences research.
Note: Regression analysis is a complex and powerful tool. This chapter introduces advanced concepts that build upon the foundational knowledge from Chapters 9 and 10.
29.2 Revisiting regression assumptions
Underlying the appropriate application of regression procedures are several key assumptions. Violations of these assumptions can affect the validity of model results.
-
Data Distribution and Outliers: Data may not always conform to normal distributions. Identifying and addressing outliers, which are observations that do not fit the general pattern of the data, is crucial. This can be done informally through scatter plots or formally with statistical tests.
Remember: The researcher is ultimately responsible for justifying the removal of any observations from a dataset prior to analysis.
-
Data Transformations: Mathematical transformations of data can be employed to address non-normality or other distributional issues. These transformations alter the data values but preserve the underlying relationships between variables.
- Common transformations include taking the square root or logarithm of measurements.
- These transformations can help normalize the data sufficiently for hypothesis tests concerning regression coefficients.
Example: Researchers studying blood concentrations of delta-9-THC used a log10 transformation on the data to address potential non-normality, as presented in Table 11.1.1 (Pages 557-558).
29.3 Qualitative independent variables
Regression models can incorporate qualitative (categorical) independent variables. This is typically achieved through the use of dummy variables (also known as indicator variables).
- A qualitative variable with k categories is represented by k−1 dummy variables.
- Each dummy variable takes a value of 0 or 1, indicating the presence or absence of a specific category.
- This allows the regression model to estimate different intercepts for each category of the qualitative variable, or to adjust the slopes if interaction terms are included.
29.4 Variable selection procedures
In multiple regression, selecting the most relevant set of predictor variables is crucial for building parsimonious and effective models. Automated variable selection procedures can aid in this process.
- These procedures systematically add or remove variables from a model based on statistical criteria.
- Common methods include:
- Forward selection: Starts with an empty model and iteratively adds the best predictor until no further improvement is significant.
- Backward elimination: Starts with a full model and iteratively removes the least significant predictor until all remaining predictors are significant.
- Stepwise regression: A combination of forward and backward steps, where variables can be added or removed at each stage.
Important: While automated methods can be useful, they should be used cautiously and in conjunction with domain knowledge, as they may not always identify the truly optimal model.
29.5 Logistic regression
Logistic regression is a statistical technique used when the dependent variable is dichotomous (binary, e.g., yes/no, success/failure). It models the probability of the outcome occurring.
- Unlike linear regression, which predicts a continuous outcome, logistic regression predicts the probability of a categorical outcome.
- The logistic function (or sigmoid function) is used to transform the linear combination of predictors into a probability between 0 and 1.
- The model estimates the log-odds of the outcome.
- Logistic regression can be extended to handle polytomous (more than two categories) dependent variables.
This section of the guide delves into advanced techniques in regression analysis, focusing on addressing common data issues and incorporating qualitative variables into models.
29.6 Addressing violations of regression assumptions
When conducting regression analysis, several assumptions must be met for the model and hypothesis tests to be valid. This section discusses common violations and potential remedies.
- Non-normal data and outliers:
- Skewed data and the presence of outliers can compromise the appropriateness of a regression model.
- Box-and-whisker plots can visually identify skewness and outliers.
- Transformations, such as a log10 transformation, can often reduce skewness and mitigate the impact of outliers, leading to a more symmetric distribution.
- While symmetry does not guarantee normality, it improves the model's appropriateness. Formal tests for normality should always be performed.
Note: A log10 transformation can be useful for highly skewed data, making the distribution more symmetric and reducing the influence of outliers 559.
-
Unequal error variances (heteroscedasticity):
- When the variances of the error terms are not equal across all levels of the independent variables, hypothesis tests on model coefficients become unreliable, even if the model equation itself is satisfactory.
- Similar to addressing non-normality, transformations of the regression variables can help reduce the impact of unequal error variances.
-
Correlated independent variables (multicollinearity):
- Multicollinearity occurs when independent variables in a model are highly correlated with each other.
- This can lead to unstable and non-unique solutions for regression coefficients because the individual contributions of correlated predictors become difficult to isolate.
- A common approach to mitigate multicollinearity is to:
- Calculate correlations among all independent variables.
- Retain only variables that are not highly correlated.
- A general rule of thumb is to remove variables that have a significant correlation coefficient above 0.7 with other independent variables, as this indicates redundancy.
Example: In a study on obesity, if both 'weight' and 'body mass index (BMI)' are included as independent variables, multicollinearity is likely because BMI is mathematically derived from weight. High correlation between these variables means they provide redundant information, and one should typically be removed 560.
29.7 Incorporating qualitative independent variables
Regression models often benefit from the inclusion of qualitative (categorical) variables alongside quantitative ones. To use qualitative variables in a regression model, they must be quantified numerically.
-
Definition of qualitative variables:
- Qualitative variables represent categories or attributes rather than numerical measurements (e.g., marital status, sex, diagnosis, race, place of residence).
- Including them can significantly improve the model's predictive power by reducing the error sum of squares.
-
Dummy variables (indicator variables):
- Dummy variables are used to quantify qualitative variables. They take on a finite number of values, typically 0 or 1, to represent different categories.
- These numerical values (0 or 1) have no inherent quantitative meaning but serve to identify distinct categories.
- Qualitative variables with only two categories are also known as dichotomous variables.
Definition: A dummy variable is a variable that assumes only a finite number of values (such as 0 or 1) for the purpose of identifying the different categories of a qualitative variable 562.
-
Coding dummy variables:
- If a qualitative variable has k categories, k−1 dummy variables are typically needed for a regression model that includes an intercept term.
- This ensures that each category is uniquely represented without introducing perfect collinearity.
Qualitative Variable Example Dummy Variable(s) Definition Number of Dummy Variables (k−1) Sex (male, female) x1=1 for male, 0 for female 1 Residence (urban, rural, suburban) x1=1 for urban, 0 otherwise; x2=1 for rural, 0 otherwise 2 Smoking status (4 categories) x1=1 for current smoker, 0 otherwise; x2=1 for ex-smoker (≤ 5 years), 0 otherwise; x3=1 for ex-smoker (> 5 years), 0 otherwise 3 -
Applications of qualitative variables in regression:
- Qualitative variables can be included in multiple regression models to account for their influence on the dependent variable.
- The analysis can be conducted assuming no interaction between independent variables, or it can be extended to account for interactions, which is often more realistic.
Example: A study predicting birth weight might include 'length of gestation' (quantitative) and 'mother's smoking status' (qualitative) as independent variables. The smoking status would be coded using dummy variables 563.
30. Analysis of variance and regression analysis (part 14)
This section explores the application of regression analysis, particularly focusing on the use of dummy variables to incorporate qualitative independent variables and strategies for selecting appropriate predictor variables in multiple regression models.
30.1 Using qualitative independent variables with regression
Qualitative independent variables can be incorporated into regression models by assigning them numerical values, typically through the use of dummy variables. This allows for the analysis of group differences and interactions within a regression framework.
30.2 Dummy variable coding
A dummy variable is a binary variable (0 or 1) used to represent a categorical predictor. For a qualitative variable with k levels, k−1 dummy variables are typically used.
- Example: In a study examining birth weights, smoking status can be represented by a dummy variable where x2=1 if the mother is a smoker and x2=0 if she is a nonsmoker 565.
30.3 Regression with a single qualitative variable
When a single qualitative variable is included in a regression model, it allows for different intercepts across the categories of the qualitative variable, while maintaining a common slope for the quantitative predictor.
- Model: For a quantitative predictor x1 and a qualitative predictor represented by dummy variable x2: y^j=β^0+β^1x1j+β^2x2j
- Interpretation:
- If x2=1 (e.g., smokers): y^j=(β^0+β^2)+β^1x1j
- If x2=0 (e.g., nonsmokers): y^j=β^0+β^1x1j This indicates that the slopes (β^1) are the same for both groups, but the intercepts (β^0 and β^0+β^2) differ. The difference in intercepts, β^2, represents the average difference in the dependent variable between the two groups when the quantitative predictor is held constant 566.
30.4 Hypothesis testing for qualitative variables
Hypothesis tests can be conducted to determine if the qualitative variable has a significant effect on the dependent variable.
- Hypothesis: H0:β2=0 vs. HA:β2=0.
- Test Statistic: t=(β^2−0)/sβ^2
- Decision: Reject H0 if the p-value is less than the significance level α.
Example: In the birth weight study, the hypothesis test for β2 (the coefficient for the smoking dummy variable) determines if smoking has a significant effect on birth weight. A computed t-statistic of -2.17 and a p-value of 0.033 led to the rejection of H0, indicating that smoking is associated with a reduction in birth weight 567.
30.5 Confidence interval for the difference in means
A confidence interval can be constructed to estimate the magnitude of the difference in the dependent variable between the groups represented by the dummy variable.
- Formula: β^2±tα/2sβ^2
- For a 95% confidence interval, t0.025 with the appropriate degrees of freedom is used.
- Interpretation: The interval provides a range of plausible values for the average difference in the dependent variable between the categories of the qualitative predictor.
Note: Using dummy variables can provide a more precise estimate of the common slope and more degrees of freedom for error mean square calculations compared to fitting separate regression lines for each group 568.
30.6 Regression with interaction terms
When interaction between a quantitative and a qualitative independent variable is suspected, interaction terms are included in the model. This allows for different slopes across the categories of the qualitative variable.
-
Model with one quantitative (X1) and one qualitative variable with two dummy variables (X2,X3): yj=β0+β1X1j+β2X2j+β3X3j+β4X1jX2j+β5X1jX3j+ej
-
Interpretation of interaction terms:
- X1jX2j and X1jX3j represent the interaction between the quantitative variable and the dummy variables.
- The model allows for different slopes and y-intercepts for each level of the qualitative variable.
-
Regression equations for each level:
- Level 1 (e.g., X2=1,X3=0): y^j=(β^0+β^2)+(β^1+β^4)x1j
- Level 2 (e.g., X2=0,X3=1): y^j=(β^0+β^3)+(β^1+β^5)x1j
- Level 3 (e.g., X2=0,X3=0): y^j=β^0+β^1x1j
Example: In a study comparing three methods (A, B, C) of treating depression, age (X1) is a quantitative variable and treatment method is qualitative. Dummy variables X2 and X3 are used for treatments A and B, respectively. The model includes interaction terms to assess if the relationship between age and treatment effectiveness differs across the three treatment methods 570 571.
30.7 Inference on slopes and intercepts with interaction
Hypothesis tests can be performed on the coefficients of the interaction terms to determine if the slopes differ significantly across the categories of the qualitative variable.
- Hypothesis for interaction: H0:β4=0 (slope for treatment A differs from treatment C) or H0:β5=0 (slope for treatment B differs from treatment C).
- Decision: Reject H0 if the p-value for the interaction term's coefficient is less than the significance level574.
Note: Testing the coefficients of the dummy variables themselves (β2,β3) allows for comparisons of y-intercepts between different levels of the qualitative variable 573.
30.8 Variable selection procedures in multiple regression
When multiple independent variables are available, selecting the most appropriate set for a regression model is crucial for maximizing predictive ability while avoiding unnecessary complexity and cost. Various strategies exist for this purpose.
30.9 Importance of variable selection
- R-squared: Adding any independent variable to a model increases R2. Therefore, variables should not be added indiscriminately but for sound statistical or practical reasons.
- Cost-effectiveness: Some variables are more expensive to collect data for. Cost-conscious investigators will only include variables that demonstrably improve the model's predictive power.
30.10 Stepwise regression
Stepwise regression is a popular strategy that iteratively adds or removes variables based on specified criteria.
- Procedure:
- Forward Selection: Starts with no variables and adds the variable that provides the best improvement at each step.
- Backward Elimination: Starts with all variables and removes the variable that least contributes to the model at each step.
- Stepwise Regression (Combined): At each step, it evaluates variables in the model for removal and variables not in the model for addition.
- Criteria: Often uses F-statistics or other measures to evaluate the contribution of variables.
- MINITAB Example: The STEPWISE procedure in MINITAB uses an F-statistic cutoff (defaulting to 4.0) for entering or removing variables. It continues until no more variables can be added or deleted.
Example: A nursing director wants to predict job performance using nurse characteristics. Stepwise regression is used to select the most relevant predictors from a set of six variables. The procedure identifies "ambition" (X3) and "initiative" (X6) as the significant predictors, resulting in a two-variable model 580.
30.11 Other selection methods
- Forward Selection: This method begins with an empty model and sequentially adds the predictor that has the strongest correlation with the dependent variable, provided it meets an inclusion criterion. The next variable considered is the one with the highest partial correlation.
- Backward Elimination: This method starts with a model containing all potential predictors and sequentially removes the predictor that has the least impact on the model's predictive power, as long as it meets a removal criterion.
Note: Different variable selection strategies may not always yield the same final model when applied to the same dataset 578.
30.12 Model evaluation and criteria
- F-to-Enter/F-to-Remove: These are cutoff values used in stepwise procedures. A variable is entered if its F-statistic is greater than F-to-Enter, and removed if its F-statistic is less than F-to-Remove.
- R-squared (R2): Measures the proportion of variance in the dependent variable explained by the independent variables.
- Adjusted R-squared (Radj2): Similar to R2 but adjusts for the number of predictors in the model, providing a more reliable measure for comparing models with different numbers of predictors.
- S (Standard Error of the Regression): A measure of the typical distance between the observed values and the regression line.
Tip: The choice of criteria (e.g., F-values) can significantly influence the resulting model. It is important to ensure that the F-to-Enter value is greater than or equal to the F-to-Remove value 581.
This section focuses on advanced regression analysis techniques for model building and variable selection.
30.13 Regression model building techniques
Regression analysis often requires selecting the most appropriate independent variables to include in the final model. The process of building a regression model involves systematically adding or removing variables based on statistical criteria to achieve a parsimonious yet explanatory model. Two common stepwise model-building procedures discussed are forward elimination and backward elimination.
30.14 Forward elimination
Forward elimination is a model-building technique that starts with a null model (containing only the intercept) and sequentially adds independent variables.
- Process:
- The procedure begins by considering all independent variables not currently in the model.
- The variable with the highest partial correlation coefficient is evaluated.
- If this variable meets a predetermined inclusion criterion (typically based on an F-statistic threshold), it is added to the model.
- This process continues, with the next variable considered being the one with the next highest partial correlation among those not yet in the model.
- Variables are added until no remaining independent variable meets the criterion for inclusion.
- Outcome: The final model includes all independent variables that satisfied the inclusion criteria during the forward selection process.
30.15 Backward elimination
Backward elimination, conversely, begins with a model that includes all potential independent variables and then systematically removes them. * The procedure starts with all independent variables included in the model. * The variable with the smallest partial correlation coefficient is identified as the first candidate for removal. * If this variable does not meet the criterion for inclusion (meaning its removal would not significantly degrade the model's explanatory power, usually indicated by failing an F-statistic test), it is eliminated from the model. * The process then moves to the variable with the next lowest partial correlation coefficient, evaluating it for removal based on the same criterion. * This continues until all variables have been considered for elimination.
- Outcome: The final model comprises only those independent variables that meet the specified inclusion criteria after the elimination process.
Note: Both forward and backward elimination are iterative processes that rely on statistical tests (e.g., F-statistic) to guide variable selection, aiming to identify a parsimonious model with significant predictors.
30.16 Exercise example: Caregiver burden regression analysis
An exercise presents a dataset for a study on family caregiving in Korea, investigating caregiver burden. The outcome variable is BURDEN (measured by the Korean Burden Inventory), and several independent variables are provided: caregiver age (CGAGE), caregiver income (CGINCOME), duration of caregiving (CGDUR), activities of daily living score (ADL), memory and behavioral problems score (MEM), cognitive impairment score (COG), and perceived social support score (SOCIALSU). The task is to perform a stepwise regression analysis using these variables to predict caregiver burden.
Example Data Structure for Exercise:
CGAGE CGINCOME CGDUR ADL MEM COG SOCIALSU BURDEN 41 200 12 39 4 18 119 28 30 120 36 52 33 9 131 68 ... ... ... ... ... ... ... ... 582 583.
31. Analysis of variance and regression analysis (part 15)
This section delves into advanced regression techniques, focusing on logistic regression for dichotomous dependent variables and touching upon multiple logistic regression and model assessment.
31.1 Logistic regression model
Logistic regression is employed when the dependent variable is discrete, most commonly dichotomous, representing two mutually exclusive outcomes (e.g., success/failure, disease present/absent). Unlike simple linear regression, where the expected value of Y can range from −∞ to +∞, in logistic regression, the expected value represents the probability of Y=1, which is constrained between 0 and 1.
The simple linear regression model is expressed as: y=β0+β1x+ϵ E[y∣x=β0+β1x
When Y is dichotomous, the expected value E[Y∣x] is the probability p=P(Y=1). Since p is bounded between 0 and 1, the linear model is inappropriate. To overcome this, logistic regression uses a transformation of p.
The odds for success are defined as the ratio of the probability of success to the probability of failure: 1−pp. The natural logarithm of this ratio, known as the logit transformation, can range from −∞ to +∞, matching the range of the linear predictor.
The logistic regression model is therefore: ln(1−pp)=β0+β1x This can be rearranged to express p as a function of x: p=1+exp(β0+β1x)exp(β0+β1x) Here, exp denotes the exponential function (inverse of the natural logarithm). This model is widely used in health sciences to model the probability (risk) of an event occurring based on predictor variables 588.
31.2 Logistic regression with dichotomous independent variable
In the simplest case, both the dependent and independent variables are dichotomous, often coded as 0 and 1. Data can be cross-classified in a 2×2 table. A key statistic in this scenario is the odds ratio.
Definition: The odds for success is the ratio of the probability of success to the probability of failure.
The odds ratio measures how much greater the odds are for subjects possessing a risk factor to experience a particular outcome, assuming the outcome is rare. For example, an odds ratio of 2 suggests the odds of experiencing the outcome are twice as high for those with the risk factor compared to those without it.
The odds ratio is directly related to the logistic regression coefficient β1, where Odds Ratio =exp(β1). Software packages commonly provide estimates of β0, β1, and the odds ratio 589.
Example: In a study of obstructive coronary artery disease (OCAD), the odds ratio for OCAD among men versus women was estimated to be 5.84, indicating that men are nearly six times more likely to have OCAD than women 590.
31.3 Logistic regression with continuous independent variable
When the dependent variable is dichotomous and the independent variable is continuous, the logistic regression model remains the same, but the interpretation of the coefficients changes. Computer software is typically used for analysis. The focus shifts to evaluating the model's adequacy and interpreting its output.
Example: A study examined factors associated with participation in cardiac rehabilitation programs among women. Age (continuous) was the independent variable, and participation (dichotomous: 1=participated, 0=did not) was the dependent variable. The logistic regression equation estimated was ln(1−p^p^)=1.8744−0.0379×AGE. The negative slope suggests a decreasing probability of participation with increasing age 592 593.
31.4 Multiple logistic regression
When multiple independent variables (continuous, discrete, or a combination) are used to predict a dichotomous outcome, multiple logistic regression is applied. The model is an extension of the simple logistic regression:
ln(1−pp)=β0+β1x1+β2x2+⋯+βkxk This can also be expressed as: p=1+exp(β0+β1x1+⋯+βkxk)exp(β0+β1x1+⋯+βkxk) where x1,x2,…,xk are the independent variables and β1,β2,…,βk are their respective coefficients 594.
Example: A study investigated early versus late onset of excessive alcohol use. The independent variables were cerebrospinal fluid (CSF) tryptophan (TRYPT) and 5-hydroxyindoleacetic acid (5-HIAA) concentrations. The logistic regression output showed that 5-HIAA was a significant predictor (p <.05), while TRYPT was not. The model was y^i=2.076−0.013x5-HIAA+0xTRYPT 595.
31.5 Assessing goodness of fit for logistic regression models
Evaluating the fit of a logistic regression model is crucial. Unlike linear regression, there isn't a direct equivalent to R2 because the parameters are estimated iteratively, not by minimizing sums of squares. Common approaches include:
- Pseudo-R2 values: Measures like the Cox and Snell R2 and Nagelkerke R2 compare a model with predictors to an intercept-only model. Higher values indicate better fit. These are useful for comparing models but provide less insight into the fit of a single model.
- Classification Table: This involves creating a contingency table that compares the observed outcomes (0 or 1) with the predicted outcomes based on the model. A rule of thumb suggests that correctly classifying 70% or more of the data indicates a satisfactory model. To avoid bias, either a portion of the data is used for model building and another for classification, or external data is used for testing.
- Plot of Predicted Probabilities: Visualizing the frequency of observations against their predicted probabilities can reveal misclassifications and their frequency.
- Hosmer and Lemeshow Test: This test compares observed and expected frequencies using a chi-square statistic to detect significant deviations 596.
Example: In assessing the cardiac rehabilitation data model, SPSS output provided Cox and Snell and Nagelkerke pseudo-R2 values. The classification table indicated that only 63% of the data were correctly reclassified, with a notable misclassification of participants 597.
Example: For the alcohol onset study, pseudo-R2 values were provided, and the classification table showed 69% correct reclassification, though there was a tendency to misclassify individuals without early onset as having it.
31.6 Polytomous logistic regression
When the response variable has more than two categories (e.g., disease present, absent, or undetermined) or is ordered (e.g., underweight, ideal weight, overweight, obese), polytomous logistic regression is used. The modeling process is more complex and typically requires specialized software 598.
31.7 Further topics in logistic regression
Advanced topics include:
- Stepwise regression analysis can be applied to logistic regression models.
- Techniques for constructing confidence intervals for odds ratios are available.
Note: Due to the complexity of calculations, computer software is highly recommended for performing logistic regression analyses and working through exercises 599 600.
This section focuses on the fundamental models and techniques used in regression analysis, including simple linear regression, logistic regression, and the application of dummy variables for categorical predictors.
31.8 Regression models and logistic regression
Regression analysis is a statistical method used to model the relationship between a dependent variable and one or more independent variables. The core idea is to find a function that best describes how changes in independent variables affect the dependent variable.
-
Simple Linear Regression Model: This model describes a linear relationship between a single independent variable (x) and a dependent variable (y).
- The model can be represented as:
y=β0+β1x+ϵ
where:
- β0 is the regression intercept.
- β1 is the regression coefficient, representing the change in y for a one-unit change in x.
- ϵ is the regression model error term, accounting for variability not explained by the model.
- Alternative representations focus on the expected value of y given x:
- E(y∣x)=β0+β1x
- The model can be represented as:
y=β0+β1x+ϵ
where:
-
Simple Logistic Regression Model: This model is used when the dependent variable is binary (dichotomous), meaning it can take on only two values (e.g., success/failure, presence/absence). It models the probability of a particular outcome.
- The model uses a logit transformation of the probability (p):
ln(1−pp)=β0+β1x
- 1−pp is the odds, the ratio of the probability of an event occurring to the probability of it not occurring.
- ln(1−pp) is the logit transformation.
- An alternative representation expresses the probability (p) directly: p=1+exp(β0+β1x)exp(β0+β1x)
- The model uses a logit transformation of the probability (p):
ln(1−pp)=β0+β1x
-
Multiple Logistic Regression Model: This is an extension of simple logistic regression used when there are multiple independent variables (x1,x2,…,xk).
- The logit transformation is modeled as a linear combination of these variables: ln(1−pp)=β0+β1x1j+β2x2j+⋯+βkxkj
- The probability (p) can also be expressed directly: p=1+exp(β0+β1x1j+β2x2j+⋯+βkxkj)exp(β0+β1x1j+β2x2j+⋯+βkxkj)
Note: The variables β0,β1,…,βk represent regression coefficients, and xij represents the value of the i-th independent variable for the j-th observation. The error term is implicitly handled within the probabilistic framework of logistic regression.
Important: Logistic regression is particularly useful in fields like health sciences for predicting the likelihood of an event (e.g., disease presence, treatment success) based on a set of predictor variables.
31.9 Dummy variable coding and applications
Dummy variables are used in regression analysis to incorporate categorical independent variables into the model. A categorical variable with k levels is typically represented by k−1 dummy variables.
- Concept: A dummy variable takes a value of 1 if a particular category is present for an observation and 0 otherwise.
- Application Example: Consider a study predicting the capacity to direct attention (CDA) in elderly subjects. Variables like age, education level, activities of daily living (IADL), and attentional demands (ADS) are used as predictors. Stepwise regression is a technique used to select the most significant variables for the final model. For instance, in a study predicting CDA, researchers might use stepwise regression with age, education, IADL, and ADS to identify the key predictors 14.
- Dummy Variable Coding in Practice:
- Exercise 15: Involves analyzing cardiac output and oxygen consumption data, treating cardiac output as the dependent variable. Dummy variable coding is used to analyze the data with adults and children (a categorical variable) as predictors alongside continuous variables 15.
- Exercise 16: Focuses on the relationship between total body potassium and total body water. Dummy variable coding is applied to quantify the sex variable (male/female) when analyzing these relationships using regression techniques 16.
Tip: When using dummy variables, it's crucial to interpret the coefficients relative to the baseline category (the category that is omitted from the dummy variable set).
31.10 Summary of regression formulas
The provided document includes a summary of key formulas for regression analysis, particularly focusing on linear and logistic regression models.
| Formula Number | Name | Formula | Symbol Key |
|---|---|---|---|
| 11.4.1–11.4.3 | Simple linear regression model | y=β0+β1x+ϵ $\mu_{y | x} = \beta_0 + \beta_1x<br>E(y |
| 11.4.4 | Simple logistic regression model | ln(1−pp)=β0+β1x | ln(1−pp): logit transformation |
| 11.4.5 | Alternative simple logistic regression model | p=1+exp(β0+β1x)exp(β0+β1x) | p: probability of the event |
| 11.4.6 | Alternative multiple logistic regression model | ln(1−pp)=β0+β1x1j+β2x2j+⋯+βkxkj | xij: value of the i-th independent variable at observation j |
[ ] 601.
32. Analysis of variance and regression analysis (part 16)
This section focuses on applying regression analysis techniques, particularly multiple linear regression, to analyze data involving categorical predictors and to assess interactions between variables.
32.1 Introduction to multiple regression with categorical predictors
Multiple linear regression is a powerful tool that can accommodate both quantitative and qualitative (categorical) independent variables. When dealing with categorical variables, dummy variable coding is employed to represent the different levels of the category within the regression model.
32.2 Dummy variable coding for categorical predictors
Dummy variables are binary variables (taking values of 0 or 1) used to represent the levels of a categorical independent variable. If a categorical variable has k levels, k−1 dummy variables are typically created. One level is chosen as the reference category, and the dummy variables represent deviations from this reference.
For a categorical variable with k categories, we can define k−1 dummy variables, say D1,D2,…,Dk−1. For an observation:
- If the observation belongs to the reference category, then D1=D2=⋯=Dk−1=0.
- If the observation belongs to category i (where i∈{1,2,…,k−1}), then Di=1 and all other Dj=0 (where j=i).
The regression coefficient associated with each dummy variable represents the difference in the mean of the dependent variable between that category and the reference category, holding other variables constant
32.3 Analyzing interactions in regression models
Interaction occurs when the effect of one independent variable on the dependent variable depends on the level of another independent variable. In a regression model, interactions can be modeled by including product terms of the independent variables.
For example, if we have a quantitative variable X and a categorical variable represented by dummy variables D1,D2, we can include interaction terms such as X⋅D1 and X⋅D2.
- If X⋅Di is included, its coefficient represents how the slope of the relationship between X and the dependent variable changes for category i compared to the reference category 604.
- A significant interaction term suggests that the relationship between the quantitative predictor and the response variable is not uniform across all categories of the qualitative predictor.
Example: In Exercise 17 (page 604), the study investigates the relationship between birth weight (dependent variable) and gestational age (quantitative predictor) in infants from three different hospitals (categorical predictor). To assess if the effect of gestational age on birth weight differs across hospitals, interaction terms between gestational age and dummy variables representing the hospitals would be included in the regression model.
32.4 Application examples and interpretation
The provided text includes several examples illustrating the application of multiple regression with categorical variables and interaction terms.
- Exercise 17 (page 604): Analyzing birth weight in preterm infants across three hospitals, considering gestational age. The aim is to determine if hospital of birth influences mean birth weight after accounting for gestational age and if there is an interaction between hospital and gestational age.
- Exercise 18 (page 605): Investigating the change in attitude (ATT) as a function of age, treatment group (control vs. pet therapy), and their interaction. This example explicitly uses a dummy variable for the treatment group and examines if the age-related effect on attitude differs between the groups.
- Exercise 19 (page 606): A trihalomethane (THM) study uses a multiple regression model with several quantitative predictors and dummy variables for seasonality (summer, spring). This highlights the use of dummy variables to capture seasonal effects.
- Exercise 21 (page 606): This exercise describes a study using stepwise logistic regression to predict cardiorespiratory morbidity. Logistic regression is a technique used when the dependent variable is binary (e.g., occurrence of morbidity or not), and it also handles quantitative and qualitative predictors.
Important Note: When interpreting regression coefficients with dummy variables, it is crucial to remember the reference category. The coefficients for the dummy variables represent the difference in the mean response compared to this reference category. The interaction terms reveal if the relationship between a continuous predictor and the response varies across the categories 605.
This section introduces the chi-square distribution and its application in analyzing frequency data through goodness-of-fit, independence, and homogeneity tests, laying the groundwork for understanding statistical relationships in categorical variables.
32.5 The chi-square distribution
The chi-square distribution is a fundamental statistical tool derived from the normal distribution, particularly useful for analyzing categorical and frequency data. It is the distribution of the sum of squared standard normal variables.
32.6 Mathematical properties of the chi-square distribution
A chi-square distribution with k degrees of freedom, denoted as χ2(k), arises from the sum of k independent squared standard normal variables: χ2(k)=z12+z22+⋯+zk2 The probability density function (PDF) of the chi-square distribution is given by: f(u)=2k/2Γ(k/2)1u(k/2)−1e−u/2,u>0 where u is the variate, k is the number of degrees of freedom, and Γ is the gamma function.
Key properties include:
- The mean of the chi-square distribution is k.
- The variance of the chi-square distribution is 2k.
- The modal value is k−2 for k≥2, and 0 for k=1.
- The distribution is non-negative, ranging from 0 to infinity.
- The sum of two or more independent chi-square variables also follows a chi-square distribution.
The shape of the chi-square distribution varies with the degrees of freedom, being distinct for k=1 and k=2 compared to k>2 602.
32.7 Types of chi-square tests
Chi-square tests are primarily used for hypothesis testing involving frequency data. The main types discussed are:
- Tests of goodness-of-fit: Comparing an observed sample distribution to a hypothesized theoretical distribution.
- Tests of independence: Examining whether two categorical variables are related or independent within a population.
- Tests of homogeneity: Determining if the proportions of a categorical variable are consistent across different populations or groups.
All these tests can be viewed as assessing the goodness-of-fit of observed frequencies to expected frequencies derived from a null hypothesis.
32.8 The chi-square test statistic
The chi-square test statistic quantifies the discrepancy between observed and expected frequencies.
32.9 Observed versus expected frequencies
- Observed frequencies (Oi): The actual counts of subjects or objects falling into specific categories within a sample.
- Expected frequencies (Ei): The counts that would be anticipated for each category if a specific null hypothesis about the population were true.
32.10 Calculation of the chi-square test statistic
The test statistic is calculated using the following formula: X2=∑Ei(Oi−Ei)2 Under the null hypothesis, X2 is approximately distributed as a chi-square distribution with k−r degrees of freedom, where k is the number of categories and r represents the number of restrictions imposed. Restrictions typically include the constraint that the sum of expected frequencies must equal the sum of observed frequencies, and any additional parameters estimated from the sample 603.
The X2 statistic is small when observed and expected frequencies are in close agreement and large when there is significant disagreement. A large X2 value suggests that the null hypothesis should be rejected. The squaring of the difference (Oi−Ei) ensures that both positive and negative deviations contribute equally to the statistic, and division by Ei standardizes the differences relative to their expected magnitudes.
32.11 Decision rule
The computed X2 value is compared to a critical value from the chi-square distribution with the appropriate degrees of freedom for a chosen significance level (α). The decision rule is:
- Reject H0 if X2≥χcritical2 (for the chosen α)
- Fail to reject H0 if X2<χcritical2
Important: The magnitude of X2 reflects the overall agreement between observed and expected frequencies. A sufficiently large X2 indicates that the observed data are unlikely to have occurred by chance if the null hypothesis were true.
32.12 Small expected frequencies
A critical consideration for the validity of the chi-square approximation is the size of expected frequencies. While there is no universal consensus, guidelines suggest that expected frequencies should ideally not be too small.
- Some sources suggest a minimum expected frequency of 5.
- Earlier guidelines sometimes recommended a minimum of 10.
- Cochran suggested that for unimodal distributions, a minimum expected frequency of 1 may be acceptable.
If small expected frequencies are encountered, adjacent categories can be combined to increase their size, though this will reduce the degrees of freedom 604.
Tip: When planning a study or analyzing data with potential for small expected counts, consider combining categories beforehand or ensuring sufficient sample size to avoid violating this assumption.
32.13 Tests of goodness-of-fit
A goodness-of-fit test is employed to determine if an observed frequency distribution is compatible with a specific, preconceived theoretical distribution.
32.14 Application
This test is used when one wants to assess if a sample of data comes from a population with a particular distribution, such as normal, binomial, or Poisson. The procedure involves:
- Categorizing observed data into mutually exclusive classes.
- Calculating expected frequencies for each category based on the hypothesized distribution.
- Using the chi-square test statistic to compare observed and expected frequencies.
- Concluding whether the sample data support or contradict the hypothesized distribution.
32.15 Example: Testing for normality
Consider a study where cholesterol levels of 47 subjects are recorded. The goal is to determine if these data provide sufficient evidence to reject the hypothesis that the sample originates from a normally distributed population.
- Data: Observed frequencies for different cholesterol level ranges are provided.
- Hypothesis: The sample comes from a normally distributed population (H0).
- Test: A chi-square goodness-of-fit test can be applied after calculating expected frequencies for each category based on a normal distribution with parameters estimated from the sample or known population parameters 605.
Note: The validity of the chi-square approximation for goodness-of-fit tests is dependent on adequate expected frequencies in each category. If expected frequencies are too small, the results may be unreliable.
33. Analysis of variance and regression analysis (part 17)
This section focuses on the chi-square distribution for goodness-of-fit and independence tests, illustrating its application in various scenarios including testing for normality, binomial, Poisson, and uniform distributions, as well as examining the independence of categorical variables.
33.1 Tests of goodness-of-fit
The chi-square goodness-of-fit test is employed to determine if an observed frequency distribution is compatible with a hypothesized theoretical distribution. The general procedure involves formulating null (H0) and alternative (HA) hypotheses, calculating a test statistic, and comparing it to a critical value from the chi-square distribution.
33.2 Steps for goodness-of-fit tests
- Hypotheses:
- H0: The sampled population follows a specific distribution.
- HA: The sampled population does not follow the specified distribution.
- Test Statistic: The chi-square test statistic is calculated as: X2=∑i=1kEi(Oi−Ei)2 where Oi is the observed frequency in the i-th category, Ei is the expected frequency in the i-th category, and k is the number of categories.
- Distribution of Test Statistic: If H0 is true, the test statistic X2 approximately follows a chi-square distribution with k−1−m degrees of freedom, where k is the number of categories and m is the number of parameters estimated from the sample data. If parameters are specified in H0, then m=0.
- Decision Rule: Reject H0 if the computed X2 value is greater than or equal to the critical chi-square value for a given significance level (α).
- Calculation of Test Statistic: Expected frequencies (Ei) are calculated based on the hypothesized distribution and the total sample size. If the mean and variance of the hypothesized distribution are not specified, they are estimated from the sample data, reducing the degrees of freedom.
Note: When hypothesized frequencies are less than 1, categories should be combined to ensure all expected frequencies are at least 1, which affects the degrees of freedom calculation.
33.3 Examples of goodness-of-fit tests
-
Testing for Normality:
- Example 12.3.1 demonstrates testing if cholesterol levels are normally distributed. The sample mean and standard deviation are estimated from grouped data. Expected frequencies are derived using z-scores corresponding to class interval limits and the cumulative area under the normal curve. The degrees of freedom are adjusted for estimating the mean and standard deviation 626.
Important: The Kolmogorov-Smirnov test is often a more appropriate test for continuous distributions compared to the chi-square test 627.
-
Testing for Binomial Distribution:
-
Testing for Poisson Distribution:
- Example 12.3.3 tests if emergency hospital admissions follow a Poisson distribution with a specified parameter λ. Expected relative frequencies are found using the Poisson function, and then multiplied by the total number of observations. If λ needs estimation, it is calculated from the sample mean. Degrees of freedom are adjusted if parameters are estimated or if categories are combined 630 631.
-
Testing for Uniform Distribution:
-
Testing for a Specified Ratio:
- Example 12.3.5 tests if a trait is inherited according to a 1:2:1 ratio. Expected frequencies are calculated by applying the given ratios to the total sample size. The degrees of freedom are k−1, where k is the number of categories representing the ratios 634.
33.4 Tests of independence
The chi-square distribution is also used to test the null hypothesis that two criteria of classification applied to the same set of entities are independent.
33.5 Contingency tables and independence
-
Contingency Table: A table used to display the classification of entities according to two criteria. An r×c table has r rows and c columns representing the levels of each criterion 637.
-
Hypotheses:
- H0: The two criteria of classification are independent in the population.
- HA: The two criteria of classification are not independent.
-
Calculating Expected Frequencies: For a cell at the intersection of row i and column j, the expected frequency (Eij) is calculated as: Eij=Grand Total(Row i Total)×(Column j Total) This formula assumes independence, where the probability of an entity falling into a specific cell is the product of the marginal probabilities of belonging to that row and column 638.
-
Test Statistic and Distribution: The chi-square test statistic is calculated using the observed (Oij) and expected (Eij) frequencies for each cell: X2=∑i=1r∑j=1cEij(Oij−Eij)2 If H0 is true, X2 is approximately distributed as a chi-square distribution with (r−1)(c−1) degrees of freedom.
-
Decision Rule: Reject H0 if the computed X2 value is greater than or equal to the critical chi-square value for a given α.
33.6 Example of a test of independence
- Example 12.4.1 tests the independence of race and preconceptional use of folic acid among pregnant women. A contingency table summarizes the observed frequencies. Expected frequencies are calculated for each cell using the marginal totals. The chi-square statistic is computed, and its value is compared to the critical value for (3−1)(2−1)=2 degrees of freedom 639 640.
Remember: Computer software like MINITAB and SAS PROC FREQ can efficiently perform these chi-square tests of independence, providing observed counts, expected counts, chi-square contributions, degrees of freedom, and p-values 641.
This section delves into the statistical methodologies of analyzing variance and regression, focusing on the Chi-square distribution and its application in contingency table analysis, particularly for testing independence between categorical variables.
33.7 Contingency tables and chi-square tests
Contingency tables are fundamental tools for analyzing the relationship between two or more categorical variables by cross-classifying their observed frequencies. The primary statistical test employed for assessing independence in these tables is the chi-square (χ2) test.
- Chi-square (χ2) statistic: This statistic quantifies the discrepancy between observed frequencies in a contingency table and the frequencies that would be expected if the variables were independent. A larger χ2 value indicates a greater difference and suggests a potential association between the variables.
- Expected cell frequencies: These are the frequencies anticipated for each cell in the contingency table under the assumption of independence. They are calculated as: Eij=Grand Total(Row i Total)×(Column j Total)
- Chi-square test statistic calculation: The χ2 statistic is computed by summing the squared differences between observed (Oij) and expected (Eij) frequencies, divided by the expected frequencies for each cell: χ2=∑all cellsEij(Oij−Eij)2
- Degrees of freedom (df): For a contingency table with r rows and c columns, the degrees of freedom are calculated as df=(r−1)(c−1). This value is crucial for determining the critical value from the chi-square distribution.
- SAS® printout interpretation: Statistical software like SAS® provides detailed output for contingency table analysis. This typically includes observed frequencies, percentages relative to row totals, column totals, and the grand total. It also presents various chi-square statistics, such as the Pearson chi-square, Likelihood Ratio Chi-Square, and Mantel-Haenszel Chi-Square, along with their corresponding p-values.
Example: In Example 12.4.1 (from the source document), a contingency table was used to analyze the relationship between 'race' and 'folic' acid intake. The SAS® printout showed cell frequencies, row and column percentages, and several chi-square statistics, indicating the level of association between these variables.
33.8 Small expected frequencies
A critical consideration in chi-square analysis is the presence of small expected frequencies in the cells of a contingency table. The validity of the chi-square approximation can be compromised when expected frequencies are too low.
- Cochran's rule: A commonly followed guideline suggests that for contingency tables with more than 1 degree of freedom:
- No more than 20 percent of cells should have expected frequencies less than 5.
- A minimum expectation of 1 is permissible if the above condition is met.
- Handling small expected frequencies: If the rule is violated, adjacent rows and/or columns may be combined, provided that such a combination is logically justifiable.
- Tolerance for smaller expected frequencies: If the χ2 statistic is based on 30 or more degrees of freedom, expected frequencies as small as 2 can be tolerated.
33.9 The 2x2 contingency table
A special case arises when both classification criteria consist of only two categories, resulting in a 2x2 contingency table. This is often referred to as a 2×2 table.
-
Observed cell frequencies: A 2×2 table can be represented as follows:
Criterion 1 Criterion 2 Total Class 1 a b a+b Class 2 c d c+d Total a+c b+d n where a,b,c,d are the observed cell frequencies and n is the grand total.
-
Shortcut formula for χ2: For a 2×2 table, the chi-square statistic can be computed more efficiently using the following formula: χ2=(a+c)(b+d)(a+b)(c+d)n(ad−bc)2
-
Degrees of freedom for a 2×2 table: Applying the general rule of df=(r−1)(c−1) to a 2×2 table (r=2,c=2) yields df=(2−1)(2−1)=1.
34. Analysis of variance and regression analysis (part 18)
This section of the study guide focuses on chi-square tests for independence and homogeneity, along with the Fisher exact test, as methods for analyzing categorical data and assessing relationships between variables.
34.1 Tests of independence
Tests of independence are used to determine if there is a statistically significant association between two categorical variables in a single sample drawn from a population. The null hypothesis states that the two variables are independent, while the alternative hypothesis states they are not. The chi-square statistic is calculated based on observed and expected frequencies within a contingency table.
- Procedure:
- Data: A contingency table is constructed, cross-classifying the observations by the two variables of interest.
- Assumptions: The sample is assumed to be a simple random sample.
- Hypotheses:
- H0: The two variables are independent.
- H1: The two variables are not independent.
- Test statistic: The chi-square statistic (X2) is calculated using the formula: X2=∑i=1kEi(Oi−Ei)2 where Oi is the observed frequency and Ei is the expected frequency for cell i.
- Distribution: Under the null hypothesis, X2 follows approximately a chi-square distribution with (r−1)(c−1) degrees of freedom, where r is the number of rows and c is the number of columns in the contingency table.
- Decision Rule: Reject H0 if the computed X2 value is greater than or equal to the critical value from the chi-square distribution for the given significance level and degrees of freedom.
- Conclusion: Based on the statistical decision, a conclusion is drawn regarding the independence of the two variables.
Example: A study investigates whether fear of falling among polio survivors leads to lifestyle changes. A contingency table is constructed from data on 233 survivors, classifying them by whether they experienced falls and whether fear of falling resulted in lifestyle changes. The chi-square test is applied to determine if there is a relationship between these two variables 644.
-
Small Expected Frequencies: The chi-square test should be used with caution if expected frequencies are small. Cochran suggests that if the total sample size (n) is less than 20, or if 20<n<40 and any expected frequency is less than 5, the test may not be appropriate. With n≥40, an expected frequency as low as 1 can be tolerated.
-
Yates's Correction: For 2×2 contingency tables, Yates's correction can be applied to account for the discrete nature of observed frequencies and the continuous nature of the chi-square distribution. This involves subtracting 0.5 from the absolute value of the difference between observed and expected frequencies before squaring. However, the necessity and utility of this correction are debated among statisticians.
Note: The characteristics of a chi-square test of independence include selecting a single sample, cross-classifying subjects on two variables, calculating expected frequencies based on the probability law of independence, and stating hypotheses and conclusions in terms of variable independence 645.
34.2 Tests of homogeneity
Tests of homogeneity are used to determine if samples drawn from different populations are homogeneous with respect to a particular categorical variable. This differs from the test of independence in that the investigator specifies independent samples from different populations, fixing one set of marginal totals while the other set is random.
* **Data:** A contingency table is constructed, with one set of categories representing the different populations and the other representing the variable of interest.
* **Assumptions:** Independent random samples are drawn from each of the specified populations.
* $H_0$: The populations are homogeneous with respect to the variable of interest (i.e., they are drawn from the same population).
* $H_1$: The populations are not homogeneous.
* **Test statistic:** The chi-square statistic ($X^2$) is calculated using the same formula as for the test of independence.
* **Distribution:** Under the null hypothesis, $X^2$ follows approximately a chi-square distribution with $(r-1)(c-1)$ degrees of freedom.
* **Decision Rule:** Reject $H_0$ if the computed $X^2$ value is greater than or equal to the critical value.
* **Conclusion:** A conclusion is drawn regarding the homogeneity of the populations.
Example: A study compares the frequency of migraine headaches in narcoleptic subjects versus healthy controls. Two independent samples are taken, and subjects are classified by their reported migraine headaches. The test of homogeneity assesses whether the narcolepsy population and the healthy population are similar concerning migraine frequency 649.
- Relationship to Proportion Tests: The chi-square test of homogeneity for two samples is equivalent to testing the null hypothesis that two population proportions are equal (H0:p1=p2). The chi-square statistic is the square of the z-statistic used for testing the difference between two proportions 651.
Important: The calculation of expected frequencies in a test of homogeneity assumes that if the populations are homogeneous, the best estimate of the proportion in a particular category is obtained by pooling the sample data 650.
34.3 The Fisher exact test
The Fisher exact test is used for analyzing 2×2 contingency tables when the sample sizes are too small to meet the minimum expected frequency requirements for the chi-square test. It calculates the exact probability of observing the data or more extreme results.
-
Data Arrangement: Data are arranged in a 2×2 contingency table, with the characteristic of interest chosen such that the number of observations with the characteristic in the first sample (a) is greater than in the second sample (b).
-
Assumptions:
-
The data consist of a specified number of observations from two independent random samples.
-
Each observation can be classified into one of two mutually exclusive types.
-
Two-sided:
- H0:p1=p2
- HA:p1=p2
-
One-sided:
- H0:p1≤p2
- HA:p1>p2 (or vice versa)
-
-
Test Statistic: The test statistic is the observed value of b, the number in sample 2 with the characteristic of interest.
-
Decision Rule: Decision rules depend on whether a one-sided or two-sided test is performed and involve comparing the observed value of b to critical values found in specialized tables (e.g., Appendix Table J), which are provided for specific significance levels.
Reminder: The Fisher exact test is particularly useful when expected frequencies are less than 5 in a 2×2 table, a condition that often violates chi-square test assumptions 654.
- Large-Sample Approximation: For sufficiently large samples, the Fisher exact test can be approximated using the normal distribution (z-test) or the chi-square test, provided that certain conditions (e.g., a,b,A−a,B−b≥5) are met.
Example: A study evaluates the long-term efficacy of a drug regimen for HIV-positive subjects. Patients are divided into two groups: PI Naive and PI Experienced. The Fisher exact test is used to determine if the PI Naive group has a lower probability of remaining on the regimen for 120 weeks compared to the PI Experienced group. The observed value of 'b' (number of PI Naive subjects who did not remain on the regimen) is compared to critical values from tables 656.
This section introduces fundamental concepts in observational studies, focusing on the calculation and interpretation of relative risk and odds ratios for dichotomous variables.
34.4 Observational studies and their types
An observational study is a scientific investigation where neither the subjects nor the variables of interest are manipulated. This is in contrast to designed experiments. In these studies, one variable is designated as the "risk factor" (independent variable) and the other as the "outcome" (dependent variable), where the risk factor is hypothesized to be related to the outcome.
34.5 Dichotomous variables in observational studies
Observational studies often involve categorical variables. When both the risk factor and outcome variables are dichotomous (having two categories), the data can be displayed in a contingency table.
34.6 Prospective studies
In a prospective study, two random samples of subjects are selected: one with the risk factor and one without. These subjects are followed over time to record the number of individuals who fall into each category of the outcome variable. The resulting data can be organized in a 2×2 contingency table.
34.7 Retrospective studies
A retrospective study is the inverse of a prospective study. Subjects are selected based on their outcome status (e.g., having a disease or not). The investigator then looks back in time to determine the presence or absence of the risk factor among these subjects. While generally less expensive than prospective studies, they resemble experiments less closely.
Note: Prospective studies are generally more expensive but more closely resemble experimental designs.
34.8 Relative risk
Relative risk is a measure used to compare the risk of an event (e.g., developing a disease) occurring in one group versus another. It is particularly meaningful for data obtained from prospective studies.
34.9 Calculation of relative risk
For a 2×2 contingency table from a prospective study:
| Risk Factor | Disease Present | Disease Absent | Total at Risk |
|---|---|---|---|
| Present | a | b | a+b |
| Absent | c | d | c+d |
The risk of disease among subjects with the risk factor is a+ba. The risk of disease among subjects without the risk factor is c+dc.
The relative risk (cRR) is defined as the ratio of these two risks: cRR=c+dca+ba 661.
A 100(1−α)% confidence interval for the relative risk can be constructed using: 100(1−α)%CI=cRR±zα/2a1−a+b1+c1−c+d1. (Note: The provided document uses Xp2 which appears to be a typo and is more accurately represented using the variance of the log of the relative risk, leading to the formula above or similar approximations involving zα/2 and the standard error of the log relative risk).
34.10 Interpretation of relative risk
- RR = 1: No association between the risk factor and the outcome. The risk is the same for both groups.
- RR > 1: Increased risk of the outcome among subjects with the risk factor. For example, an RR of 2 means subjects with the risk factor are twice as likely to experience the outcome.
- RR < 1: Decreased risk of the outcome among subjects with the risk factor.
Example: In a prospective study, if the relative risk of preterm labor for women who exercised extensively during pregnancy compared to those who did not is 1.1, it suggests a slightly increased risk of preterm labor associated with extensive exercise. If the 95% confidence interval for this RR includes 1, we cannot conclude a statistically significant increased risk at the.05 level of significance 662.
34.11 Odds ratio
When data are collected from a retrospective study, the relative risk is not the appropriate measure. Instead, the odds ratio is used to compare cases and controls.
34.12 Calculation of odds ratio
For a 2×2 contingency table from a retrospective study:
| Risk Factor | Cases (Disease Present) | Controls (Disease Absent) |
|---|---|---|
| Present | a | b |
| Absent | c | d |
The odds of having the risk factor among cases are ca. The odds of having the risk factor among controls are db.
The odds ratio (cOR) is defined as the ratio of these two odds: cOR=b/da/c=bcad.
Important: In retrospective studies, the ratio a+ba does not estimate the risk of disease for subjects with the risk factor. The odds ratio is the appropriate measure for comparing groups 663.
35. Analysis of variance and regression analysis (part 19)
This section delves into the analysis of categorical data, focusing on the odds ratio for assessing associations between binary variables and the Mantel-Haenszel statistic for controlling confounding variables in retrospective and prospective studies.
35.1 Odds ratio and confidence interval
The odds ratio is a measure used to quantify the association between a binary exposure (risk factor) and a binary outcome (case/control status).
- Odds: The ratio of the probability of success to the probability of failure.
- Odds of being a case/control among subjects with risk factor: The ratio of cases to controls in the group with the risk factor present, calculated as ba, where a is the number of cases with the risk factor and b is the number of controls with the risk factor.
- Odds of being a case/control among subjects without risk factor: The ratio of cases to controls in the group without the risk factor, calculated as dc, where c is the number of cases without the risk factor and d is the number of controls without the risk factor.
- Estimate of the population odds ratio (cOR): This is calculated from sample data using the formula: cOR=c/da/b=bcad.
A table summarizing the classification of subjects according to a risk factor and case/control status:
| Sample | Cases | Controls | Total |
|---|---|---|---|
| Risk Factor Present | a | b | a+b |
| Risk Factor Absent | c | d | c+d |
| Total | a+c | b+d | n |
-
Interpretation of the Odds Ratio:
- A value of 1 indicates no association between the risk factor and disease status.
- A value less than 1 indicates reduced odds of the disease among subjects with the risk factor.
- A value greater than 1 indicates increased odds of having the disease among subjects with the risk factor.
- For rare diseases, the odds ratio approximates the relative risk 665.
-
Confidence Interval for the Population Odds Ratio (OR): A confidence interval can be constructed to estimate the range of the true population odds ratio. 100(1−α)% CI=cOR±zα/2a1+b1+c1+d1 Note: The document provides a slightly different formula for the standard error: 100(1−α)% CI=cOR±zα/2Xp2 where X2 is computed by Equation 12.4.1. However, the more common and direct calculation for the standard error of the log odds ratio, which is then used to construct the confidence interval for the odds ratio itself, is derived from the variance of the log odds ratio, ln(cOR), which is a1+b1+c1+d1. The confidence interval for ln(OR) is ln(cOR)±zα/2a1+b1+c1+d1, and then exponentiating gives the CI for OR. The provided equation in the text seems to use a component derived from the chi-square calculation. For example, in Example 12.7.2, the calculation for the confidence interval uses 217.6831 which is derived from the chi-square statistic calculation 664.
Example: Calculating a 95 percent confidence interval for the odds ratio of obesity related to maternal smoking during pregnancy. The calculated odds ratio was 9.62, and the chi-square statistic was 217.6831. The 95 percent confidence interval is approximately 7.12 to 13.00. Since this interval does not contain 1, it indicates a statistically significant association between maternal smoking and childhood obesity.
Note: SPSS output provides similar results, with slight differences due to rounding 666.
35.2 Mantel-Haenszel statistic
The Mantel-Haenszel statistic is employed when a potential confounding variable may influence the relationship between a suspected risk factor and a disease. This technique allows for controlling for such variables to obtain an unambiguous measure of association.
- Confounding Variable: A variable associated with both the disease and the risk factor, which can mask or distort the true relationship between them.
- Stratification: The Mantel-Haenszel procedure involves dividing the data into strata, where each stratum corresponds to a category of the confounding variable.
- Application: The procedure is suitable for data from retrospective or prospective studies where cases and noncases are classified by risk factor status. If the confounding variable is continuous, it must be categorized.
The steps involved in applying the Mantel-Haenszel procedure are:
- Form strata: Create k strata based on the k categories of the confounding variable. Table 12.7.5 displays the data for the i-th stratum.
- Compute expected frequency (ei): For each stratum, calculate the expected frequency for the upper left-hand cell (cases with risk factor present): ei=ni(ai+bi)(ai+ci) 667.
- Compute vi: For each stratum, calculate: vi=ni2(ni−1)(ai+bi)(ci+di).
- Compute the Mantel-Haenszel test statistic (χMH2): χMH2=∑i=1kvi(∑i=1kai−∑i=1kei)2.
- Decision Rule: Reject the null hypothesis of no association if the computed χMH2 is greater than or equal to the critical chi-square value for 1 degree of freedom at the chosen significance level.
A table summarizing the data display for the i-th stratum:
| Sample | Cases (OCAD) | Noncases | Total (ni) |
|---|---|---|---|
| Risk Factor Present | ai | bi | ai+bi |
| Risk Factor Absent | ci | di | ci+di |
| Total | ai+ci | bi+di | ni |
-
Mantel-Haenszel Estimator of the Common Odds Ratio (cORMH): This estimator is computed under the assumption that the odds ratio is consistent across all strata. cORMH=∑i=1kbici/ni∑i=1kaidi/ni.
Example: Analyzing the association between hypertension (risk factor) and obstructive coronary artery disease (OCAD, case/noncase) across two age strata (55 and under, over 55). The Mantel-Haenszel statistic is used to test the null hypothesis of no association, controlling for age. The calculated expected frequencies for the strata were e1=21.93 and e2=49.45 668 669.
36. Nonparametric and distribution-free statistics (part 1)
This section introduces nonparametric and distribution-free statistical methods that do not rely on assumptions about the specific distribution of the sampled population, offering flexibility when parametric assumptions are violated or unknown.
36.1 Introduction to nonparametric and distribution-free statistics
Parametric statistical tests, such as the t-test and ANOVA, assume that the data are drawn from a population that follows a specific probability distribution, typically the normal distribution. When these assumptions are not met, the validity of the conclusions drawn from parametric tests can be compromised. Nonparametric statistics, also known as distribution-free statistics, provide a valuable alternative by requiring fewer or no assumptions about the population's distribution. This makes them particularly useful in situations involving small sample sizes, ordinal data, or skewed distributions 670.
36.2 Key nonparametric tests and their applications
The following sections detail several fundamental nonparametric tests, outlining their purpose, hypotheses, and general application.
36.3 The sign test
The sign test is a simple nonparametric test used to compare two related samples or to test hypotheses about a single median. It is based on the direction (sign) of the difference between pairs of observations, ignoring the magnitude of the difference. This test is particularly useful for paired data where the difference between pairs can be assessed.
Hypotheses:
- Null Hypothesis (H0): The median difference between paired observations is zero, or the population median is equal to a specified value.
- Alternative Hypothesis (Ha): The median difference is not zero, or the population median is not equal to a specified value (two-sided), or the median difference is greater than or less than zero (one-sided).
The test statistic is typically the number of positive or negative signs.
36.4 The Wilcoxon signed-rank test
The Wilcoxon signed-rank test is a more powerful nonparametric test than the sign test for paired data. It uses the ranks of the absolute differences between paired observations, incorporating information about the magnitude of these differences. It is used to test hypotheses about the median of a single population or to compare two related samples.
- Null Hypothesis (H0): The median difference between paired observations is zero.
- Alternative Hypothesis (Ha): The median difference is not zero (two-sided), or the median difference is greater than or less than zero (one-sided).
The test involves ranking the absolute differences and then summing the ranks of the positive and negative differences. The test statistic is often the smaller of these two sums.
Note: The Wilcoxon signed-rank test is generally preferred over the sign test when the data are approximately symmetric, as it utilizes more information from the data.
36.5 The median test
The median test is a nonparametric test used to determine whether two or more independent samples come from populations with the same median. It is a simpler alternative to the Mann-Whitney U test when comparing medians.
- Null Hypothesis (H0): The medians of the populations from which the samples are drawn are equal.
- Alternative Hypothesis (Ha): The medians are not all equal.
This test involves comparing the number of observations above and below the overall median of the combined samples, often using a chi-square contingency table.
36.6 The Mann-Whitney test (also known as the Wilcoxon rank-sum test)
The Mann-Whitney U test is a widely used nonparametric test for comparing two independent samples. It tests whether it is equally likely that a randomly selected item from one population will be less than or greater than a randomly selected item from the second population. It is the nonparametric equivalent of the independent samples t-test.
- Null Hypothesis (H0): The distributions of the two populations are identical.
- Alternative Hypothesis (Ha): The distributions of the two populations are different (often specifically testing for a difference in medians or central tendency).
The test works by ranking all observations from both samples combined and then comparing the sum of ranks for each sample.
Important: The Mann-Whitney U test is robust against violations of normality and homogeneity of variance assumptions, making it suitable for many real-world scenarios.
36.7 The Kolmogorov-Smirnov goodness-of-fit test
The Kolmogorov-Smirnov (K-S) goodness-of-fit test is a nonparametric test used to compare a sample distribution to a reference probability distribution (e.g., normal, exponential, uniform) or to compare two independent samples. For the goodness-of-fit aspect, it assesses whether a sample comes from a specific hypothesized distribution.
Hypotheses for goodness-of-fit:
- Null Hypothesis (H0): The sample distribution matches the specified theoretical distribution.
- Alternative Hypothesis (Ha): The sample distribution does not match the specified theoretical distribution.
The test statistic is the maximum absolute difference between the empirical cumulative distribution function (ECDF) of the sample and the cumulative distribution function (CDF) of the theoretical distribution.
36.8 The Kruskal-Wallis ANOVA
The Kruskal-Wallis H test is a nonparametric test used to compare three or more independent samples. It is the nonparametric equivalent of the one-way analysis of variance (ANOVA). This test is used to determine if there are statistically significant differences between the medians of three or more independent groups.
- Null Hypothesis (H0): The medians of all populations from which the samples are drawn are equal.
- Alternative Hypothesis (Ha): At least one population median is different from the others.
The test involves ranking all observations from all groups combined and then comparing the sum of ranks for each group.
36.9 The Friedman two-way ANOVA
The Friedman test is a nonparametric test used to compare three or more related samples. It is the nonparametric equivalent of the repeated-measures ANOVA. This test is employed when measurements are taken on the same subjects under three or more different conditions, or when data are blocked into groups of three or more related samples.
- Null Hypothesis (H0): The distributions of the treatments or conditions are identical.
- Alternative Hypothesis (Ha): At least one treatment or condition distribution is different from the others.
The test ranks the data within each block (e.g., subject) and then compares the sum of ranks across the different conditions.
36.10 Spearman rank correlation
Spearman's rank correlation coefficient (ρ or rs) is a nonparametric measure of the strength and direction of a monotonic relationship between two ranked variables. It assesses how well the relationship between two variables can be described using a monotonic function. It does not assume a linear relationship, unlike Pearson's correlation.
- Null Hypothesis (H0): There is no monotonic relationship between the two variables.
- Alternative Hypothesis (Ha): There is a monotonic relationship (positive or negative) between the two variables.
The calculation involves ranking the data for each variable separately and then computing the Pearson correlation coefficient on these ranks.
Tip: Spearman correlation is useful when dealing with ordinal data or when the relationship between two variables is monotonic but not strictly linear.
This covers the foundational nonparametric and distribution-free statistics presented in pages 670-681, focusing on tests that do not require assumptions about the underlying distribution of the data.
Nonparametric and distribution-free statistical methods are employed when assumptions about the underlying distribution of the sampled population are not met or when one wishes to perform statistical inference without making such assumptions.
36.11 Introduction to nonparametric and distribution-free statistics
Parametric statistics, such as the t-test, typically rely on assumptions about the population distribution, often requiring normality. Nonparametric statistics, on the other hand, either do not involve hypotheses about population parameters or do not make assumptions about the sampled population's distribution, making them "distribution-free." The terms nonparametric and distribution-free are often used interchangeably.
Key advantages of nonparametric statistics:
- They enable the testing of hypotheses that are not solely focused on population parameter values.
- They can be utilized when the functional form of the sampled population is unknown.
- Nonparametric procedures can be computationally simpler and faster than their parametric counterparts, though this is less of a concern with modern statistical software.
- They are applicable to data that consist of rankings or classifications, even when interval or ratio scale data are not available.
36.12 Measurement scales
Nonparametric methods are particularly useful when data are measured on nominal (categorical) or ordinal (ranked) scales. While parametric tests usually require interval or ratio scale data, nonparametric tests can be applied to weaker measurement scales.
36.13 Core nonparametric tests covered (introduction)
This section will introduce several fundamental nonparametric statistical tests that are used for hypothesis testing and association analysis without assuming a specific population distribution. These include tests for comparing groups, assessing goodness-of-fit, and measuring correlation.
36.14 The sign test
The sign test is a simple nonparametric test used to compare two related samples or to test a hypothesis about a single median. It operates by examining the signs of the differences between paired observations. For a single sample, it tests the hypothesis that the population median is a specific value. For two related samples, it tests whether the median difference between pairs is zero 689.
36.15 The Wilcoxon signed-rank test
A more powerful alternative to the sign test for paired data, the Wilcoxon signed-rank test also assesses the median difference between two related samples. It takes into account not only the sign of the differences but also their ranks. This test is used to test hypotheses about the location parameter (median) of a symmetric distribution.
36.16 The median test
The median test is a nonparametric test used to compare two or more independent groups based on their medians. It tests the null hypothesis that the populations from which the samples are drawn have the same median. The test involves comparing observed frequencies in a contingency table against expected frequencies based on the overall median of the combined sample.
36.17 The Mann–Whitney test
Also known as the Wilcoxon rank-sum test, the Mann–Whitney test is a nonparametric test used to compare two independent groups. It tests the null hypothesis that the two populations from which the samples are drawn have identical distributions, or more specifically, that the medians of the two populations are equal. It is often considered a nonparametric alternative to the independent samples t-test.
36.18 The Kolmogorov–Smirnov goodness-of-fit test
The Kolmogorov–Smirnov (K-S) goodness-of-fit test is a nonparametric test used to determine if a sample comes from a specified distribution. It compares the empirical cumulative distribution function (ECDF) of the sample data with the cumulative distribution function (CDF) of the hypothesized distribution. The test statistic is the maximum absolute difference between the ECDF and the CDF.
36.19 The Kruskal–Wallis one-way analysis of variance by ranks
The Kruskal–Wallis test is a nonparametric method for testing whether samples originate from the same population. It is used to compare three or more independent groups and is the nonparametric equivalent of the one-way ANOVA. It tests the null hypothesis that the medians of all populations are equal. The test works by ranking all observations from all groups and then comparing the sum of ranks for each group.
36.20 The Friedman two-way analysis of variance by ranks
The Friedman test is a nonparametric test used to detect differences in treatments across three or more related groups. It is the nonparametric equivalent of the two-way ANOVA for related samples or repeated measures. It tests the null hypothesis that there is no difference among the medians of the populations from which the samples are drawn. The data are ranked within each block (e.g., subject or time period), and then these ranks are analyzed.
36.21 The Spearman rank correlation coefficient
Spearman's rank correlation coefficient (ρ or rs) is a nonparametric measure of rank correlation (statistical dependence between the rankings of two variables). It assesses how well the relationship between two variables can be described using a monotonic function. It is essentially the Pearson correlation coefficient calculated on the ranks of the data. Values range from -1 to +1, indicating perfect negative monotonic correlation, no monotonic correlation, or perfect positive monotonic correlation, respectively 688.
37. Nonparametric and distribution-free statistics (part 2)
This section explores nonparametric statistical tests that do not require assumptions about the underlying distribution of the data, offering alternatives to parametric tests when those assumptions are violated or when dealing with ordinal data.
37.1 The sign test
The sign test is a nonparametric alternative to the t-test for testing hypotheses about a population median or the median difference between paired observations. It is particularly useful when the normality assumption of the t-test cannot be met or when data are measured on an ordinal scale. The test relies only on the assumption that the distribution of the variable is continuous, allowing it to be used with nominal data in its basic form but requiring more careful consideration for continuous variables.
The core principle of the sign test is to record the direction (positive or negative) of the difference between an observation and a hypothesized median, or between paired observations.
37.2 Single sample sign test
This variant tests a null hypothesis about the median of a single population.
- Hypotheses:
- H0: The population median is equal to a specified value (m0).
- HA: The population median is not equal to m0 (two-sided), or HA: The population median is greater than m0 or HA: The population median is less than m0 (one-sided).
- Test Statistic: The number of plus signs (observations above m0) or minus signs (observations below m0).
- Assumptions:
- The data are from a continuous variable.
- The sample is random.
- Procedure:
- For each observation, determine if it is above (+), below (−), or equal to the hypothesized median (m0).
- Observations equal to m0 are typically discarded, reducing the effective sample size (n).
- The null hypothesis can be restated as P(+)=P(−)=0.5.
- The test statistic is either the count of plus signs or minus signs. For a two-sided test, the less frequently occurring sign is used.
- The sampling distribution of the test statistic (number of pluses or minuses) under the null hypothesis follows a binomial distribution with parameters n (effective sample size) and p=0.5.
- Decision Rule: Reject H0 if the probability of observing a test statistic as extreme or more extreme than the calculated value is less than or equal to the significance level (α). For a two-sided test, α is split between the two tails.
Example: A researcher wants to know if the median score of mentally retarded girls on a personal care and grooming test is different from 5. Ten girls were tested. Scores above 5 are marked with '+', below with '-', and equal to 5 with '0'. The results after discarding the zero observation are: 8 '+', 1 '-', and 1 '0'. The effective sample size is n=9. With H0:median=5 and HA:median=5, the number of minus signs is the test statistic. The probability of observing 1 or fewer minus signs in 9 trials with p=0.5 is P(X≤1∣n=9,p=0.5)=0.0195. If α=0.05, then since 0.0195<0.05/2=0.025, H0 is rejected. The p-value for a two-sided test is 2×0.0195=0.0390 1 693.
37.3 Paired sample sign test
This variant tests the null hypothesis that the median difference between paired observations is zero.
* $H_0$: The median difference is zero ($P(+) = P(-) = 0.5$).
* $H_A$: The median difference is not zero ($P(+) \neq P(-)$), or $H_A$: The median difference is positive ($P(+) > P(-)$), or $H_A$: The median difference is negative ($P(+) < P(-)$).
- Test Statistic: The number of plus signs or minus signs of the differences between paired observations.
- The population of differences is a continuous variable.
- The sample of pairs is random.
- Calculate the difference for each pair (Xi−Yi).
- Record the sign of the difference: '+' if Xi>Yi, '-' if Xi<Yi.
- Discard pairs where the difference is zero.
- The null hypothesis is that the probability of a plus sign equals the probability of a minus sign (0.5).
- The test statistic is the count of either plus or minus signs. For a one-sided test, the statistic is chosen based on the direction of the alternative hypothesis. For a two-sided test, the less frequent sign is used.
- The sampling distribution follows a binomial distribution with parameters n (effective sample size after discarding zeros) and p=0.5.
- Decision Rule: Reject H0 if the probability of observing a test statistic as extreme or more extreme than the calculated value is less than or equal to α.
Example: A study investigates the effect of oral hygiene instruction. Twelve pairs of patients were matched. One member of each pair received instruction. Scores indicate oral hygiene level (lower scores are better). The differences Xi−Yi (Instructed - Not Instructed) were calculated. Results: 1 zero, 2 pluses, and 9 minuses. Effective n=11. H0: Median difference is zero. HA: Median difference is negative (instruction is beneficial). The test statistic is the number of plus signs, k=2. The probability of observing 2 or fewer plus signs in 11 trials with p=0.5 is P(X≤2∣n=11,p=0.5)=0.0327. If α=0.05, since 0.0327<0.05, H0 is rejected. The p-value is 0.0327 696.
37.4 Normal approximation for the sign test
For large sample sizes (n≥12 typically, where np>5 and nq>5), the binomial distribution of the sign test statistic can be approximated by the normal distribution.
- Test Statistic: A z-score calculated using a continuity correction: z=0.5nk±0.5−0.5n where k is the count of the less frequent sign, and the ±0.5 term is added if k<n/2 and subtracted if k>n/2 to incorporate the continuity correction 697.
37.5 The Wilcoxon signed-rank test for location
The Wilcoxon signed-rank test is a nonparametric alternative to the one-sample or paired-sample t-test when the normality assumption is not met, but the data are at least interval-scaled and the population is symmetric. It utilizes the magnitudes of the differences, making more efficient use of the data than the sign test.
37.6 Assumptions
- The variable is continuous.
- The population distribution is symmetric about its mean (m).
- The measurement scale is at least interval.
37.7 Hypotheses
The test can be used to test hypotheses about an unknown population mean (m0):
- H0:m=m0 versus HA:m=m0 (two-sided)
- H0:m≤m0 versus HA:m<m0 (one-sided)
- H0:m≥m0 versus HA:m>m0 (one-sided) 700.
37.8 Procedure
- Calculate differences: Subtract the hypothesized mean (m0) from each observation: di=xi−m0. Discard any observations where di=0, reducing n.
- Rank absolute differences: Rank the absolute values of the non-zero differences (∣di∣) from smallest to largest. Tied values receive the average of the ranks they would occupy.
- Assign signed ranks: Assign each rank the sign of its corresponding original difference (di).
- Sum ranks: Calculate T+ (sum of ranks with positive signs) and T− (sum of ranks with negative signs).
- Test Statistic: The test statistic is either T+ or T−, depending on the alternative hypothesis. For a two-sided test (m=m0), the test statistic is the smaller of T+ and T−, denoted as T. For HA:m<m0, T+ is used. For HA:m>m0, T− is used 701.
37.9 Decision Rule
Critical values for T, T+, or T− are found in appendix tables (e.g., Table K).
- For HA:m=m0, reject H0 if the calculated T is less than or equal to the critical value for n and α/2.
- For HA:m<m0, reject H0 if the calculated T+ is less than or equal to the critical value for n and α.
- For HA:m>m0, reject H0 if the calculated T− is less than or equal to the critical value for n and α.
Example: To test if the population mean cardiac output is different from 5.05 liters/minute, data from 15 patients were used. Differences (xi−5.05) were calculated, their absolute values ranked, and signs assigned. The sum of positive ranks (T+) was 86, and the sum of negative ranks (T−) was 34. The test statistic T=min(86,34)=34. For n=15 and α=0.05 (two-sided), the critical value from Table K is 25. Since the calculated T=34 is greater than the critical value of 25, H0 is not rejected. The population mean may be 5.05 liters/minute. The p-value is 2×P(T≤34 for n=15)≈0.1514 702.
37.10 Wilcoxon matched-pairs signed-ranks test
This is a specific application of the Wilcoxon signed-rank test for paired data, where the differences between pairs (di) are analyzed to test hypotheses about the median difference (mD). The procedure is identical to the single-sample case, with m0 replaced by the hypothesized median difference (usually 0) 703.
This section delves into additional nonparametric statistical tests, namely the median test and the Mann-Whitney test, which offer alternatives to parametric methods when distributional assumptions are not met, focusing on ordinal or continuous data.
37.11 The median test
The median test is a nonparametric method used to test the hypothesis that two independent samples come from populations with the same median. It is particularly useful when data is at least ordinal but does not meet the assumptions for parametric tests like the t-test.
37.12 Assumptions
The median test relies on the following assumptions:
- Independent and random sampling: Samples must be independently and randomly drawn from their respective populations.
- Population form: The populations are assumed to be of the same general form, differing primarily in location (median).
- Measurement scale: The variable of interest must be continuous and measured on at least an ordinal scale.
- Sample sizes: The two samples do not need to be of equal size.
37.13 Hypotheses
The hypotheses for the median test are:
- Null Hypothesis (H0): The medians of the two sampled populations are equal (MU=MR).
- Alternative Hypothesis (HA): The medians of the two sampled populations are not equal (MU=MR).
Here, MU represents the median of the urban population and MR represents the median of the rural population.
37.14 Test statistic and distribution
The test statistic used in the median test is the chi-square statistic (χ2), computed for a 2×2 contingency table. When the null hypothesis is true and the assumptions are met, χ2 is approximately distributed as a chi-square distribution with 1 degree of freedom.
Note: The calculation of the chi-square statistic for the median test is identical to that used for a 2×2 contingency table, as described in Equation 12.4.1.
37.15 Calculation and decision rule
The procedure involves:
- Computing the common median: All observations from both samples are combined and arranged in ascending order. The median is then calculated from this combined dataset. If the total number of observations is even, the median is the average of the two middle values.
- Constructing a contingency table: For each sample, the number of observations falling above and below the common median is determined. These frequencies are then organized into a 2×2 contingency table, showing counts above and below the median for each group.
- Applying the chi-square test: If the conditions for a 2×2 contingency table regarding sample size and expected frequencies are met, the chi-square test is applied.
The decision rule is to reject H0 if the computed χ2 value exceeds the critical value for a chi-square distribution with 1 degree of freedom at the chosen significance level (e.g., χ1,0.052=3.841) 705.
Example: For a sample of urban and rural students, the common median was calculated as 33.5. A 2×2 table showed 6 urban scores above the median and 10 below, versus 8 rural scores above and 4 below. Using the chi-square formula χ2=2.33. Since 2.33<3.841, the null hypothesis of equal medians could not be rejected at the 0.05 significance level.
37.16 Handling values equal to the median
Observations exactly equal to the common median require special handling. One approach is to drop these values from the analysis if they are few and the total sample size is large. Alternatively, observations equal to the median can be grouped with those below the median, effectively dichotomizing scores into "exceeding the median" and "not exceeding the median" 706.
37.17 Extension to k samples
The median test can be extended to compare medians of more than two independent groups (k samples). A 2×k contingency table is constructed using frequencies above and below the combined median. The χ2 test statistic is then computed and compared to a critical value from a chi-square distribution with k−1 degrees of freedom, provided sample size and expected frequency conditions are met.
Example of Computer Analysis: MINITAB can be used to perform the median test. Data is entered into columns, with one column for measurements and another for group codes. The output includes the chi-square statistic, degrees of freedom, and p-value 707.
37.18 The Mann-Whitney test
The Mann-Whitney test, also known as the Mann-Whitney-Wilcoxon test, is a powerful nonparametric procedure that offers an alternative to the median test and can be used instead of the independent samples t-test when parametric assumptions are violated. It utilizes more information from the data by ranking all observations, making it more sensitive than the median test.
37.19 Assumptions
The Mann-Whitney test is based on the following assumptions:
- Independent and random samples: Two samples of sizes n and m must be independently and randomly drawn from their respective populations.
- Population distribution: If the populations differ, they should differ only in their medians. This assumption is crucial for interpreting results regarding medians. If the populations are symmetric, conclusions about medians can also apply to means 708.
37.20 Hypotheses
The Mann-Whitney test can be used to test hypotheses about population medians:
- Two-sided test: H0: MX=MY (medians are equal); HA: MX=MY (medians are not equal).
- One-sided test: H0: MX=MY; HA: MX>MY (median of population X is larger than population Y).
- One-sided test: H0: MX=MY; HA: MX<MY (median of population X is smaller than population Y).
Here, MX and MY represent the medians of population X and population Y, respectively.
37.21 Test statistic calculation
The calculation of the Mann-Whitney test statistic involves the following steps:
- Combine and rank: All observations from both samples are pooled and ranked in ascending order from smallest to largest.
- Handle ties: Tied observations are assigned the mean of the rank positions they would occupy if they were distinct.
- Sum of ranks: The sum of the ranks for one of the samples (e.g., sample X) is computed. This sum is often denoted as W or U.
Example: An experiment assessed the effect of cadmium oxide inhalation on hemoglobin levels. Fifteen animals were exposed (X) and 10 were controls (Y). The combined data was ranked. For instance, if the smallest value was 13.7 (from group X), it would receive rank 1 709.
Important: When dealing with ties, ensure that the average rank is calculated correctly and assigned to all tied observations to maintain the integrity of the ranking process.
The test statistic is derived from the sum of ranks. For instance, the Mann-Whitney U statistic can be calculated based on the sum of ranks of one of the groups. The distribution of the test statistic under the null hypothesis allows for the determination of p-values or comparison with critical values.
38. Nonparametric and distribution-free statistics (part 3)
This section delves into several nonparametric statistical tests designed to analyze data without making strict assumptions about the underlying population distribution, focusing on the Mann-Whitney test, the Kolmogorov-Smirnov goodness-of-fit test, and the Kruskal-Wallis one-way analysis of variance by ranks.
38.1 The Mann-Whitney test
The Mann-Whitney test, also known as the Wilcoxon rank-sum test, is a nonparametric alternative to the independent two-sample t-test. It is used to test hypotheses about the equality of medians or location parameters of two independent populations. This test ranks all observations from both samples combined and then compares the sum of ranks for each sample.
Procedure for the Mann-Whitney Test
- Combine and Rank Data: All observations from both samples are pooled and ranked from smallest to largest. Ties are handled by assigning the average rank.
- Calculate Test Statistic: The test statistic, often denoted as T or U, is based on the sum of the ranks for one of the samples. For sample sizes n and m, the formula for T can be expressed as: T=C0nm+2n(n+1)S (This formula appears to be a variation or derived from standard ones, the document uses a simpler form related to rank sums in the example) A more common formulation related to the sum of ranks (S) for the first sample (X) of size n, from a combined sample of size N=n+m, is: T=nmS−2n(n+1) However, the provided text primarily uses a simplified version where T is directly related to the sum of ranks. For instance, with S being the sum of ranks for sample X: T=C0n(n+1)/2S where n is the number of observations in sample X.
- Determine Distribution of Test Statistic: Critical values are found in tables (e.g., Appendix Table L) for small sample sizes.
- Decision Rule: The decision rule depends on the alternative hypothesis:
- For H0:MX=MY vs. HA:MX<MY: Reject H0 if computed T<wα.
- For H0:MX=MY vs. HA:MX>MY: Reject H0 if computed T>w1−α.
- For H0:MX=MY vs. HA:MX=MY: Reject H0 if computed T<wα/2 or T>w1−α/2. Here, wα and w1−α are critical values from the distribution of T for sample sizes n and m, and significance level α. For two-sided tests, w1−α/2 is adjusted as nm/C0wα/2.
Example of Mann-Whitney Decision Rule: If n=15, m=10, and α=0.05 for a one-sided test (HA:MX<MY), and the critical value w0.05 from Table L is 45, then H0 is rejected if the computed T is less than 45.
Large-Sample Approximation
When sample sizes are large (e.g., n or m>20), the test statistic T can be approximated by a standard normal distribution (z). The formula for the z-score is: z=12nm(n+m+1)T−2nm The computed z value is then compared to critical values from the standard normal distribution.
Note on Mann-Whitney vs. Wilcoxon: The Mann-Whitney test is algebraically equivalent to the Wilcoxon rank-sum test. Computer output often provides values for both, related by the equation U+W=2nm+2n+1 in the absence of ties.
38.2 The Kolmogorov-Smirnov goodness-of-fit test
The Kolmogorov-Smirnov (K-S) goodness-of-fit test is a nonparametric test used to determine if a sample comes from a specific theoretical distribution. It compares the sample cumulative distribution function (FS(x)) with the theoretical cumulative distribution function (FT(x)).
Procedure for the Kolmogorov-Smirnov Goodness-of-Fit Test
- Hypotheses:
- H0:F(x)=FT(x) for all x (The sample comes from the specified distribution).
- HA:F(x)=FT(x) for at least one x (The sample does not come from the specified distribution).
- Assumptions:
- The sample must be a random sample.
- The hypothesized distribution FT(x) must be continuous. The test is conservative if the theoretical distribution is discrete or if parameters are estimated from the sample.
- Test Statistic: The test statistic, D, is the greatest vertical distance between the sample cumulative distribution function (FS(x)) and the theoretical cumulative distribution function (FT(x)): D=supx∣FS(x)−FT(x)∣ where 'sup' denotes the supremum or least upper bound.
- Decision Rule: Reject H0 if the computed value of D exceeds the critical value found in tables (e.g., Appendix Table M) for the given sample size (n) and significance level (α).
Important Consideration for Calculating D: The maximum difference D might not occur at an observed data point. It is crucial to consider differences at points between observed values as well. The correct value of D can be found by computing: D=max1≤i≤r+1{max∣FS(xi)−FT(xi)∣,∣FS(xi−1)−FT(xi)∣} where r is the number of distinct observed values and FS(x0)=0.
Advantages and Disadvantages Compared to Chi-Square Goodness-of-Fit
- Advantages:
- Does not require data grouping, utilizing all information.
- Applicable to any sample size.
- Can be used with continuous theoretical distributions.
- Disadvantages:
- Not directly applicable when parameters must be estimated from the sample (unlike chi-square, which adjusts degrees of freedom).
- Assumes a continuous theoretical distribution.
38.3 The Kruskal-Wallis one-way analysis of variance by ranks
The Kruskal-Wallis test is a nonparametric alternative to the one-way analysis of variance (ANOVA). It is used to test the hypothesis that three or more independent samples come from populations with identical location parameters (typically medians), without assuming normality or equal variances.
Procedure for the Kruskal-Wallis Test
- Combine and Rank Data: All observations from the k samples are combined into a single series of size n. The data are ranked from smallest to largest (1 to n). Ties are handled by assigning the average rank.
- Calculate Rank Sums: The sum of ranks for each of the k groups (Rj) is calculated.
- Compute Test Statistic (H): The test statistic H is calculated using the formula:
H=n(n+1)12∑j=1knjRj2−3(n+1)
where:
- k is the number of samples.
- nj is the number of observations in the jth sample.
- n is the total number of observations across all samples (n=∑j=1knj).
- Rj is the sum of the ranks in the jth sample.
- Determine Distribution of Test Statistic:
- For small sample sizes (e.g., k=3 and nj≤5), exact critical values are found in tables (e.g., Appendix Table N).
- For larger sample sizes (at least one nj>5), the H statistic approximately follows a chi-square distribution with k−1 degrees of freedom.
- Decision Rule: Reject the null hypothesis (H0: all population medians are equal) if the computed H value is large enough to fall into the rejection region (determined by critical values from tables or the chi-square distribution).
Adjustment for Ties: If ties are present, the H statistic can be adjusted by dividing by a factor: (1−n3−n∑(ti3−ti)) where ti is the number of tied observations in the ith group of ties. This adjustment generally increases H, so if the unadjusted H is significant, the adjusted H will also be significant.
Example of Kruskal-Wallis Application: A study comparing eosinophil cell counts in guinea pigs exposed to air, benzaldehyde, or acetaldehyde. The Kruskal-Wallis test was used to determine if there was a significant difference in these counts among the three exposure groups, with the null hypothesis being that the populations do not differ in eosinophil cell count.
Note on Data Measurement: The Kruskal-Wallis test is applicable when the measurement scale is at least ordinal, and the distributions are identical except for the possibility of differences in location.
39. Nonparametric and distribution-free statistics (part 4)
This section delves into advanced nonparametric statistical methods, including the Friedman two-way ANOVA for ranked data and the Spearman rank correlation coefficient for assessing the association between ranked variables.
39.1 The Friedman two-way analysis of variance by ranks
The Friedman two-way analysis of variance by ranks is a nonparametric test used to analyze data arranged in a two-way classification, analogous to the parametric two-way ANOVA. It is particularly useful when assumptions for parametric ANOVA are not met, the measurement scale is ordinal, or quick results are needed. The test is appropriate for data measured on at least an ordinal scale and structured in blocks (rows) and treatments (columns).
Assumptions:
- Observations within each block are independent.
- Measurements are at least on an ordinal scale.
Hypotheses:
- H0: The treatments all have identical effects.
- HA: At least one treatment tends to yield larger observations than at least one of the other treatments.
Test Statistic: The test statistic, denoted as χr2, is computed as follows: χr2=nk(k+1)12∑j=1kRj2−3nk(k+1) where:
- n = the number of rows (blocks)
- k = the number of columns (treatments)
- Rj = the sum of the ranks for the j-th column
Distribution of Test Statistic: Critical values for χr2 for various values of n and k are found in specialized tables. For larger samples where k or n exceed table limits, the χ2 distribution with k−1 degrees of freedom is used.
Handling Ties: When original data are measurements and ties occur, assigned ranks are the mean of the ranks for which the values are tied.
Example: A physical therapist compared three models of electrical stimulators. Nine therapists ranked the models. The sums of ranks for the models were R1=15, R2=25, and R3=14. With n=9 therapists and k=3 models, the test statistic was calculated as: χr2=9×3(3+1)12(152+252+142)−3×9×(3+1)=8.222 Consulting an appendix table, a χr2 value of 8.222 with k−1=2 degrees of freedom has a probability of p=0.016. This leads to rejecting the null hypothesis, concluding that the models are not equally preferred 732 734.
39.2 The Spearman rank correlation coefficient
The Spearman rank correlation coefficient, denoted by rs, is a nonparametric measure used to assess the strength and direction of the monotonic relationship between two ranked variables. It is an attractive method due to its computational simplicity.
Hypotheses:
- H0: The two variables (X and Y) are mutually independent.
- HA: The two variables are not mutually independent (two-sided test).
- HA: There is a tendency for large values of X and large values of Y to be paired together (one-sided, direct correlation).
- HA: There is a tendency for large values of X to be paired with small values of Y (one-sided, inverse correlation).
Procedure:
- Rank the values of X from 1 to n and the values of Y from 1 to n, where n is the number of pairs of observations.
- For each pair, compute the difference di between the rank of Xi and the rank of Yi.
- Square each di and compute the sum of the squared differences, ∑di2.
- Compute the Spearman rank correlation coefficient using the formula: rs=1−n(n2−1)6∑di2
Distribution of Test Statistic:
- For sample sizes 4≤n≤30, critical values of rs are found in specialized tables. The decision rule depends on whether the test is one-sided or two-sided.
- For sample sizes n>30, a z-score approximation can be used: z=n−11rs where the critical values are obtained from the standard normal distribution table.
Handling Ties:
- Small number of ties: Assign the mean of the tied ranks to each tied observation and proceed with the standard calculation.
- Large number of ties: A correction factor T can be applied: T=12t3−t, where t is the number of observations tied for a particular rank. The formula for rs is then adjusted: rs=2∑x2∑y2∑x2+∑y2−∑di2 where ∑x2=12n3−n−∑Tx and ∑y2=12n3−n−∑Ty. Tx and Ty are the sums of the correction factors for tied ranks in X and Y, respectively. However, in practice, the correction for ties often makes little difference unless the number of ties is excessive.
Example: A study investigated the relationship between age (X) and EEG output (Y) in 20 subjects. The investigator suspected an inverse correlation. After ranking the data and calculating di2, the sum ∑di2=2340 was obtained. With n=20, the Spearman correlation was calculated: rs=1−20(202−1)6×2340=−798012360=−0.76 For a one-sided test at α=0.05 with n=20, the critical value from Table P is r0.05=0.3789. Since the computed rs=−0.76 is less than −0.3789, the null hypothesis of independence is rejected, concluding an inverse relationship between age and EEG output739.
Note: For samples with n>30 and ties, a z-score calculation is used, and for comparing rs values, standard normal distribution tables are consulted 737 741.
40. Survival analysis (part 1)
This topic introduces survival analysis, a statistical methodology for analyzing time-to-event data, focusing on the concepts of censoring, survival curves, and methods for comparing them.
40.1 Introduction to time-to-event data and censoring
Survival analysis is a branch of statistics used to analyze the time until an event of interest occurs. This type of data is known as "time-to-event" data. The "event" can be anything from death, disease recurrence, equipment failure, or any other outcome of interest.
A crucial aspect of survival analysis is censoring. Censoring occurs when the event of interest has not occurred for a subject by the end of the study period, or when a subject is lost to follow-up before the event occurs. In such cases, we only have partial information about the survival time.
There are two primary types of censoring:
- Right-censoring: This is the most common type, where we know that the event has not occurred up to a certain time point, but we do not know when (or if) it will occur later. For example, if a patient is still alive at the end of a study, their survival time is right-censored at the study's end.
- Left-censoring: This occurs when we only know that the event occurred before a certain time point, but we do not know exactly when. This is less common in medical research.
- Interval-censoring: This occurs when we only know that the event occurred within a specific time interval.
Understanding censoring is vital because simply excluding censored observations would lead to biased results. Survival analysis methods are designed to properly incorporate this partial information.
40.2 Estimating survival curves: The Kaplan-Meier procedure
The Kaplan-Meier estimator is a non-parametric statistical method used to estimate the survival function from lifetime data. The survival function, denoted by S(t), represents the probability that an individual survives beyond time t.
The Kaplan-Meier estimator calculates the survival probability at each time point where an event occurs. It accounts for censored observations by adjusting the number of individuals at risk at each time interval.
The formula for the Kaplan-Meier estimator is: S^(t)=∏ti≤t(1−nidi) where:
- S^(t) is the estimated survival probability at time t.
- ti are the distinct times at which events occur.
- di is the number of events (deaths) that occur at time ti.
- ni is the number of individuals at risk (i.e., who have survived up to time ti and have not been censored before ti).
Example: Imagine a study with 5 patients.
- Patient 1: Dies at time 3.
- Patient 2: Censored at time 4.
- Patient 3: Dies at time 5.
- Patient 4: Dies at time 7.
- Patient 5: Censored at time 8.
The Kaplan-Meier estimator would calculate the survival probability at each event time (3, 5, 7), adjusting for those who have been censored or experienced an event prior to that time.
The resulting survival curve is a step function that decreases over time, indicating the declining probability of survival.
40.3 Comparing survival curves: Log-rank test
When comparing survival experiences between two or more groups (e.g., a treatment group vs. a control group), the log-rank test is a commonly used non-parametric statistical test. It assesses whether there is a statistically significant difference between the survival distributions of these groups.
The log-rank test compares the observed number of events in each group to the expected number of events under the null hypothesis that the survival distributions are the same across all groups. It gives more weight to events that occur earlier in the follow-up period.
The null hypothesis (H0) for the log-rank test is that the survival functions for all groups are identical. The alternative hypothesis (Ha) is that at least one group has a different survival function.
Tip: The log-rank test is powerful because it does not assume a specific shape for the survival curves but only that the hazard rates are proportional or equal across groups.
40.4 Introduction to Cox regression for modeling with covariates
While Kaplan-Meier curves and log-rank tests provide descriptive and comparative insights, they do not easily incorporate the influence of other variables (covariates) on survival time. Cox proportional hazards regression is a semi-parametric model that allows for the analysis of survival data while accounting for one or more covariates.
The Cox model estimates the effect of covariates on the hazard rate, which is the instantaneous rate of the event occurring at a given time, given that the individual has survived up to that time. The model assumes that the hazard rate for any individual can be expressed as a function of their covariates and a baseline hazard function.
The core equation for the Cox proportional hazards model is: h(t∣x)=h0(t)exp(β1x1+β2x2+⋯+βpxp)
- h(t∣x) is the hazard rate at time t for an individual with covariate values x=(x1,x2,…,xp).
- h0(t) is the baseline hazard function, representing the hazard when all covariates are zero.
- βj are the regression coefficients, which represent the change in the log-hazard for a one-unit increase in the corresponding covariate xj.
- exp(βj) is the hazard ratio (HR), indicating the multiplicative change in the hazard for a one-unit increase in xj. An HR of 1 means the covariate has no effect on the hazard. An HR greater than 1 indicates an increased hazard, and an HR less than 1 indicates a decreased hazard.
Important: The "proportional hazards" assumption is critical for the Cox model. It implies that the ratio of the hazards for any two individuals remains constant over time, regardless of the time t. This assumption needs to be checked after fitting the model.
The Cox model is widely used because it does not require specifying the shape of the baseline hazard function and can handle multiple covariates simultaneously.
This section introduces survival analysis, a statistical methodology focused on analyzing time-to-event data, particularly in the presence of censoring.
40.5 Introduction to survival analysis
Survival analysis is a field of statistics concerned with the analysis of data where the primary outcome is the time until a specific event occurs. While historically associated with patient survival times, its applications extend to any scenario where the duration until an event is of interest. These events can range from clinical outcomes like disease recurrence or death, to non-clinical events such as equipment failure or the time taken for a process to complete. The core of survival analysis involves understanding and modeling these time-to-event variables, often in conjunction with other influencing factors known as covariates
Note: The fundamental outcomes in survival analysis studies are:
- The event of interest occurs.
- The subject is lost to follow-up or withdraws from the study.
- The event of interest does not occur within the study period. These are considered mutually exclusive events.
40.6 Time-to-event data and censoring
Survival analysis fundamentally deals with "time-to-event data," which consists of measurements of the elapsed time from a defined starting point (e.g., study enrollment, diagnosis) until a specific, well-defined event occurs. This elapsed time is referred to as the "survival time" or "time-to-event." In addition to the time-to-event, researchers often collect "covariates," which are other variables that might influence the event's occurrence (e.g., age, gender, treatment group).
A critical aspect of time-to-event data is the phenomenon of censoring. Censoring occurs when the exact time of the event is not observed for all subjects. This can happen for several reasons:
- The subject drops out of the study.
- The subject is lost to follow-up (e.g., moves away).
- The study concludes before the event occurs for certain subjects.
In such cases, we only know that the event did not occur up to the point of censoring. Survival analysis methods are designed to appropriately incorporate this partial information from censored observations.
Definition: Survival data or time-to-event data refers to measurements of elapsed time from initial study enrollment until the final disposition of the study subject. This can represent the time of initial diagnosis or the point at which a specific outcome is observed 769.
40.7 The Kaplan-Meier procedure
The Kaplan-Meier procedure is a non-parametric method used to estimate the survival function from observed time-to-event data, particularly when censoring is present. The survival function, denoted as S(t), represents the probability that an individual survives beyond a specific time t. It is a crucial tool for visualizing and summarizing the survival experience of a group 768.
The procedure works by calculating the probability of survival at each distinct event time. For each interval between event times, the survival probability is updated based on the number of individuals who were at risk and the number who experienced the event. When censoring occurs, individuals who are censored are removed from the risk set at the time of their censoring, but they still contribute information up to that point.
The Kaplan-Meier estimate of the survival function at time t, denoted as S^(t), is calculated as:
\hat{S}(t) = \prod_{i: t_i \le t} \left( 1 - \frac{d_i}{n_i} \right) * $t_i$ are the distinct event times in the data, ordered such that $t_1 < t_2 < \dots < t_k$. * $n_i$ is the number of subjects at risk (i.e., alive and not censored) just before time $t_i$. * $d_i$ is the number of events (deaths or other specified events) occurring at time $t_i$. The product is taken over all distinct event times $t_i$ that are less than or equal to the time $t$ for which the survival probability is being estimated. > **Example:** Imagine a study with 5 subjects, and the observed event times (or censoring times) are 10, 15, 20, 25, and 30. If at time 15, two events occur, the calculation at time 15 would consider the number at risk before time 15 and subtract the proportion that experienced an event. The survival probability at time 20 would then be the survival probability at time 15 multiplied by the survival probability from time 15 to 20. The Kaplan-Meier estimate results in a step function that decreases only at observed event times, remaining constant between these times. ## 40.8 Comparing survival curves A common goal in survival analysis is to compare the survival experiences of two or more groups. This might involve comparing the survival rates of patients receiving different treatments or individuals with different risk factors. The **log-rank test** is a widely used statistical test for comparing survival distributions between groups. The log-rank test is a non-parametric test that compares the entire survival experience over the observation period, giving more weight to earlier events. It is based on comparing the observed number of events in each group to the expected number of events, assuming the null hypothesis of no difference in survival between the groups is true. The test statistic for the log-rank test is typically calculated based on the observed and expected counts of events across all distinct event times. Under the null hypothesis of equal survival distributions, this statistic follows a chi-squared distribution with $k-1$ degrees of freedom, where $k$ is the number of groups being compared. > **Note:** The log-rank test is sensitive to differences in survival at any point in time. Alternative tests, such as the Wilcoxon test, give more weight to events that occur later in the follow-up period. The choice of test can depend on the specific nature of the expected differences between groups. ## 40.9 Cox regression: Introduction to proportional hazards models While Kaplan-Meier curves provide a non-parametric estimate of survival and log-rank tests compare these curves, **Cox regression**, also known as the **proportional hazards model**, offers a powerful method for modeling time-to-event data in the presence of multiple covariates. This technique allows for the estimation of the effect of various factors on the hazard rate. The hazard rate, denoted as $h(t)$, represents the instantaneous risk of experiencing the event at time $t$, given that the subject has survived up to time $t$. The Cox proportional hazards model assumes that the hazard rate for an individual with a specific set of covariates can be expressed as a baseline hazard function multiplied by a function of the covariates. The model is defined as: h(t | \mathbf{x}) = h_0(t) \exp(\beta_1 x_1 + \beta_2 x_2 + \dots + \beta_p x_p) * $h(t | \mathbf{x})$ is the hazard rate at time $t$ for an individual with covariate values $\mathbf{x} = (x_1, x_2, \dots, x_p)$. * $h_0(t)$ is the baseline hazard function, representing the hazard rate when all covariates are zero. This function is not explicitly modeled but is handled through the partial likelihood estimation. * $\exp(\beta_1 x_1 + \dots + \beta_p x_p)$ is the exponential function of a linear combination of the covariates, where $\beta_j$ are the regression coefficients for each covariate $x_j$. The coefficients $\beta_j$ represent the change in the log hazard ratio associated with a one-unit increase in the corresponding covariate $x_j$. The term $\exp(\beta_j)$ is known as the **hazard ratio (HR)**. An HR greater than 1 indicates an increased hazard (and thus reduced survival), while an HR less than 1 indicates a decreased hazard (and thus improved survival). > **Important Concept:** The core assumption of the Cox proportional hazards model is that the ratio of the hazards for two individuals with different covariate values remains constant over time. This is the "proportional hazards" assumption. This assumption needs to be checked after fitting the model. # 41. Survival analysis (part 2) This section delves into survival analysis, focusing on time-to-event data, censoring, estimating survival curves using the Kaplan-Meier procedure, comparing these curves with log-rank tests, and introducing Cox regression for covariate modeling. ## 41.1 Time-to-event data and censoring Survival analysis deals with time-to-event data, where "survival" refers to the absence of an event of interest, not necessarily life or death. This data includes the time elapsed until an event occurs or until the observation period ends without the event occurring. ## 41.2 Censored data Censored data arises when the exact survival time is unknown. This can occur due to several mechanisms: * **Type I censoring:** A fixed number of subjects enter a study simultaneously, and some do not experience the event by the study's end. Their survival time is known to be *greater than* the study duration. * **Type II censoring:** The study ends after a specific proportion of subjects experience the event of interest. The remaining subjects, who have not experienced the event, have censored survival times. * **Progressively censored data:** Subjects may enter the study at different times. The study period is fixed, but individuals might experience the event or have unknown survival times if they do not experience it by the study's end. * **Right-censored data:** The survival time extends beyond the observation period due to the subject dropping out, being withdrawn, or surviving past the study's termination. * **Left-censored data:** The exact start time of the event is unknown, for example, when a condition developed before the subject entered the study. A **status variable** (typically 0 for censored, 1 for event occurrence) is commonly used to distinguish between subjects who experienced the event and those whose survival time was censored. ## 41.3 Statistical distribution functions in survival analysis Several functions describe the temporal distribution of events: * **Cumulative distribution function ($F(t)$):** Represents the probability that an event occurs by a specific time $t$. It increases from 0 to 1. $$F(t) = P(T \le t)$$ * **Survival distribution function ($S(t)$):** This is the complement of the cumulative distribution function and is more commonly used in survival analysis. It represents the probability that an individual survives beyond time $t$. It decreases from 1 to 0. $$S(t) = 1 - F(t) = P(T > t)$$ * **Probability distribution function ($f(t)$):** Represents the probability density of an event occurring within a defined interval of time. It is defined as the probability of an event occurring in an infinitesimally small time interval $Dt$. $$f(t) = \frac{P(t \le T < t + \Delta t)}{\Delta t}, \text{ as } \Delta t \to 0$$ It can also be expressed using changes in $F(t)$ or $S(t)$: $$f(t) = \frac{\Delta F(t)}{\Delta t} = -\frac{\Delta S(t)}{\Delta t}$$ * **Hazard function ($h(t)$):** Defines the instantaneous probability of an event occurring at time $t$, given that the individual has survived up to time $t$. It's a conditional probability. $$h(t) = \frac{P(t \le T < t + \Delta t | T \ge t)}{\Delta t}, \text{ as } \Delta t \to 0$$ It can be expressed as: $$h(t) = \frac{f(t)}{S(t)}$$ The hazard function can exceed 1 and is influenced by prior survival. > **Note:** While the hazard function is based on conditional probability, it is not strictly a probability itself as it can exceed 1. Common distributions used for hazard functions include lognormal, exponential, and Weibull. ## 41.4 The Kaplan-Meier procedure The Kaplan-Meier procedure, also known as the product-limit method, is a non-parametric technique used to estimate the survival function from observed survival times, especially when the theoretical distribution of survival times is unknown. It involves calculating the proportion of subjects surviving successive time intervals. ## 41.5 Calculation steps Let $n$ be the number of subjects with available survival times. The proportion of subjects surviving at least the $t$-th time period, given they survived the $(t-1)$-th period, is estimated by: $$\hat{p}_t = \frac{\text{Number of subjects surviving at least } t-1 \text{ time periods who also survive the } t\text{-th period}}{\text{Number of subjects alive at the end of time period } t-1}$$ The estimated cumulative survival probability to time $t$, denoted as $\hat{S}(t)$, is the product of these conditional survival proportions up to time $t$: $$\hat{S}(t) = \hat{p}_1 \times \hat{p}_2 \times \dots \times \hat{p}_t$$ > **Example:** Estimating survival for patients with primary malignant tumors of the sternum, categorized by tumor grade. The procedure involves ordering survival times, noting vital status (dead or censored), calculating the number of patients at risk at each event time, and then computing conditional and cumulative survival proportions. ## 41.6 Interpreting Kaplan-Meier results Key statistics derived from Kaplan-Meier analysis include: * **Median survival time:** The time at which the cumulative survival proportion reaches 0.5. If no cumulative proportion is exactly 0.5, it is estimated from the interval where the proportion crosses this threshold. * **Survival rate at a specific time:** The cumulative survival proportion at that specified time (e.g., 5-year survival rate). * **Mean survival time:** The average of observed survival times. This can be an underestimate if many times are censored. * **Average hazard rate:** Calculated by dividing the number of deaths by the sum of observed survival times. A higher average hazard rate indicates a lower probability of survival. The cumulative survival proportions can be visualized as a **survival curve**, typically a step function where steps occur at times of death. ## 41.7 Comparing survival curves Comparing survival curves is crucial for evaluating differences between groups, such as treatment effects or prognoses based on patient characteristics. Objective statistical tests are needed to determine if observed differences are statistically significant and can be generalized to the population. ## 41.8 The log-rank test The **log-rank test** is a non-parametric test used to compare the survival distributions of two or more groups. It is an extension of the Mantel-Haenszel procedure and treats each death time as a stratum. ## 41.9 Calculation principles 1. **Order all observed survival times** (excluding censored times) from both groups combined. Each distinct time point forms a stratum. 2. For each stratum (time $t_i$), construct a $2 \times 2$ contingency table comparing the number of observed deaths and the number of patients alive in each group. 3. For each stratum, calculate the **expected number of deaths** in one group, given the marginal totals of the table. 4. For each stratum, compute a variance term ($v_i$). 5. The log-rank statistic is calculated by summing the differences between observed and expected deaths across all strata, weighted by the variance. This is equivalent to the Mantel-Haenszel statistic. $$ \chi^2_{\text{MH}} = \frac{\sum (O_i - E_i)}{\sum V_i} $$ where $O_i$ is the observed number of deaths in a group at stratum $i$, $E_i$ is the expected number of deaths, and $V_i$ is the variance. > **Example:** Applying the log-rank test to compare survival curves for patients with low-grade versus high-grade tumors. The test assesses if the observed differences in survival distributions are statistically significant. A significant p-value leads to the rejection of the null hypothesis of no difference in survival experiences between the groups. ## 41.10 Alternative tests for comparing survival curves Besides the log-rank test, other methods exist: * **Breslow test (Generalized Wilcoxon test):** Gives more weight to early deaths. * **Tarone-Ware test:** Also gives more weight to early deaths. * **Peto test:** Also emphasizes the earlier part of the survival curve, where the number of subjects at risk is larger. The choice of test depends on whether the researcher wishes to give more weight to survival events occurring earlier in the follow-up period. > **Important:** Statistical software packages like SPSS can perform survival analyses, construct survival curves, and compute various comparison tests, including the log-rank, Breslow, and Tarone-Ware tests. ## 41.11 Introduction to Cox regression While not fully detailed in the provided text for this section, Cox regression is mentioned as a method for developing more complex models that incorporate covariates (e.g., age, gender, income) to predict time-to-event data. It allows for the modeling of the hazard rate as a function of these covariates, enabling the assessment of their individual and combined effects on survival. This is typically covered in "Survival analysis (part 3)". This section introduces Cox regression, a proportional hazards model used to analyze time-to-event data while accounting for covariates. ## 41.12 Introduction to Cox regression Cox regression, also known as proportional hazards regression, is a statistical method used to model time-to-event data when independent variables (covariates) may influence the event occurrence. It extends basic survival analysis by allowing for the inclusion of continuous and discrete covariates to adjust for their effects on survival time. This is particularly useful in scenarios like clinical trials where baseline characteristics can affect patient outcomes. The core idea of Cox regression is to model the hazard function, which represents the instantaneous rate of an event occurring at a specific time, given that the individual has survived up to that time. The model assumes that covariates multiplicatively affect this baseline hazard function. The model is expressed as: $$ h(t_i) = h_0(t_i) \exp(\beta_1 z_{i1} + \beta_2 z_{i2} + \dots + \beta_k z_{ik}) $$ where: - $h(t_i)$ is the hazard rate for the $i$-th individual at time $t_i$. - $h_0(t_i)$ is the baseline hazard function, representing the hazard when all covariates are zero. - $z_{i1}, z_{i2}, \dots, z_{ik}$ are the values of the $k$ covariates for the $i$-th individual. - $\beta_1, \beta_2, \dots, \beta_k$ are the regression coefficients that quantify the effect of each covariate. The exponentiated regression coefficients, $\exp(\beta_j)$, represent the hazard ratio (HR) for a one-unit increase in the corresponding covariate $z_{ij}$. A hazard ratio greater than 1 indicates an increased hazard, while a hazard ratio less than 1 indicates a decreased hazard. This is why the method is termed "proportional hazards" regression – it assumes the ratio of hazards between any two individuals with different covariate values remains constant over time. > **Note:** Estimating the regression coefficients ($\beta$) in Cox regression typically requires statistical software packages, as there isn't a simple closed-form equation for direct calculation. Software output usually provides coefficient estimates, their standard errors, hazard ratios, and confidence intervals. ## 41.13 Interpreting Cox regression output When using statistical software for Cox regression, several key outputs are important for interpretation: * **Overall Model Significance:** Similar to other regression models, an overall test (e.g., Omnibus Test for Model Coefficients using likelihood-ratio tests) assesses whether the inclusion of the covariates significantly improves the model fit compared to a null model (a model with no predictors). A significant p-value (e.g., $p < .001$) indicates that at least one covariate is significantly related to the time-to-event outcome. * **Variables in the Model:** For each covariate entered into the model, software provides: * The estimated regression coefficient ($\hat{\beta}$). * The standard error of the coefficient. * A significance test (e.g., Wald test) for the null hypothesis $H_0: \beta = 0$. A low p-value for a covariate suggests it is a significant predictor of the time to event. * The hazard ratio ($\exp(\hat{\beta})$), which represents the multiplicative change in the hazard for a one-unit increase in the covariate. * Confidence intervals for the hazard ratio. * **Hazard Ratios and Interpretation:** Hazard ratios are crucial for understanding the magnitude and direction of a covariate's effect. * If $\exp(\hat{\beta}) > 1$, the hazard of the event increases with increasing values of the covariate. * If $\exp(\hat{\beta}) < 1$, the hazard of the event decreases with increasing values of the covariate. * If $\exp(\hat{\beta}) \approx 1$, the covariate has little to no effect on the hazard. > **Example:** For a continuous covariate like age, the function $100(\exp(\hat{\beta}) - 1)$ can be used to estimate the percent change in the hazard for each one-unit increase in the covariate. * **Survival Curves:** Visualizations of survival curves, often generated by software for different covariate values (e.g., for different categories of a categorical covariate), are invaluable for comparing the impact of covariates on survival patterns. ## 41.14 Example of Cox regression analysis Consider a study investigating factors influencing time to relapse among drug users. The covariates of interest are patient age and drug of choice (opiates vs. other drugs). Time to relapse is recorded in weeks, and censoring occurs when a patient is lost to follow-up. Using statistical software (e.g., SPSS), a Cox regression model is fitted with 'drug' (coded such that opiates are the indicator variable) and 'age' as predictors. The output might reveal: * An overall significant model ($p < .001$). * 'Drug' is a significant predictor of time to relapse ($p < .001$). * 'Age' is not a significant predictor ($p = .792$). Further examination of hazard ratios: * For 'drug', if opiates are coded as 1 and other drugs as 0, the hazard ratio $\exp(\hat{\beta}_{\text{drug}})$ might be approximately 8.492. This indicates that, controlling for age, individuals who use opiates as their primary drug of choice have about 8.5 times the hazard of relapse compared to those using other drugs. * The hazard ratio for 'age' would be close to 1, reflecting its non-significant impact in this model. The survival curves would likely show a substantially faster relapse rate for users of opiates compared to users of other drugs, visually confirming the statistical finding. > **Tip:** When a categorical variable (like 'drug of choice') is included, one category serves as the reference group. The hazard ratio compares the hazard of the other category to this reference group. The interpretation should explicitly mention this comparison. # 42. Survival analysis (part 3) This section delves into the practical application and interpretation of survival analysis, specifically focusing on Cox regression for modeling time-to-event data with covariates and understanding the implications of parameter estimates. ## 42.1 Cox regression for modeling time-to-event data Cox regression is a powerful technique for analyzing time-to-event data when covariates are involved. It allows us to model how the hazard rate of an event changes in relation to one or more predictor variables. The core of the Cox model is the proportional hazards assumption, which posits that the ratio of hazards between two individuals with different covariate values remains constant over time. ### 42.1.1 The proportional hazards model The hazard regression model is expressed as: $$h_i(t) = h_0(t) \exp(\beta_1 z_{i1} + \beta_2 z_{i2} + \dots + \beta_k z_{ik})$$. where: * $h_i(t)$ is the hazard rate for individual $i$ at time $t$. * $h_0(t)$ is the baseline hazard function, representing the hazard when all covariates are zero. * $\beta_j$ are the regression coefficients for each covariate $j$. * $z_{ij}$ are the values of the covariates for individual $i$. The proportional hazard model is derived from this by expressing the hazard ratio: $$\frac{h_i(t)}{h_0(t)} = \exp(\beta_1 z_{i1} + \beta_2 z_{i2} + \dots + \beta_k z_{ik})$$ [792](#page=792). This formulation highlights how the covariates multiplicatively affect the baseline hazard. > **Important:** A key assumption of the Cox model is that the hazard ratios are constant over time (proportional hazards). ### 42.1.2 Interpreting Cox regression parameter estimates The regression coefficients ($\beta$) in the Cox model can be exponentiated to obtain hazard ratios (HR). A hazard ratio represents the multiplicative change in the hazard rate for a one-unit increase in a specific covariate, assuming all other covariates remain constant. * **Hazard Ratio (HR) > 1:** Indicates an increased hazard (higher risk of the event occurring). * **Hazard Ratio (HR) < 1:** Indicates a decreased hazard (lower risk of the event occurring). * **Hazard Ratio (HR) = 1:** Indicates no effect of the covariate on the hazard. #### Example interpretation of hazard ratios Consider a study where 'Age' is a covariate. If the hazard ratio for age is 1.02, it means that for each one-year increase in age, the hazard of the event increases by approximately 2 percent, assuming other factors are constant. Mathematically, this is often interpreted as: $$HR = e^\beta$$ So, a $\beta$ value of 0.19 for weight in exercise 14.5.1 means the hazard ratio is $e^{0.19} \approx 1.21$. This implies that for each one-unit increase in weight, the hazard of cancer onset increases by about 21 percent. Similarly, for gender in exercise 14.5.2, a parameter estimate of 0.77 yields a hazard ratio of $e^{0.77} \approx 2.16$. This suggests that individuals in the specified group (e.g., males if females are the reference) have approximately 2.16 times the hazard of developing cancer compared to the reference group. Exercise 14.5.3 provides further examples: * **Age (50+ vs. <50):** HR = 1.69. Patients aged 50 or older have a 69% higher hazard of recurrence compared to those younger than 50. * **Tumor size (>2 cm vs. ≤2 cm):** HR = 1.32. Tumors larger than 2 cm have a 32% higher hazard of recurrence. * **Chemotherapy vs. no chemotherapy:** HR = 0.88. Chemotherapy is associated with a reduced hazard of recurrence by about 12% (1 - 0.88). * **Radiation vs. no radiation:** HR = 0.54. Radiation therapy is associated with a significantly reduced hazard of recurrence by about 46% (1 - 0.54). #### Alternative measures for HR interpretation For continuous variables like age, the hazard ratio can sometimes be expressed in terms of percentage change for a specific increment. For instance, if the HR for age is 1.02, this means for each year of age, the hazard increases by 2%. To express this as a percentage change in years, one could consider a 10-year increment: $(1.02)^{10} \approx 1.219$, indicating a 21.9% increase in hazard for every 10 years of age. ### 42.1.3 Time-dependent covariates In some scenarios, the value of a covariate can change over the follow-up period for an individual. These are known as time-dependent covariates. Examples include changes in marital status, employment, or the development of a new medical condition. In contrast, time-constant covariates, such as gender or genetic predispositions, do not change over time. Cox regression can be extended to handle time-dependent covariates, though it adds complexity to the modeling process. ### 42.1.4 Model selection and interactions Similar to standard regression models, Cox regression models can involve multiple covariates. Techniques such as forward selection, backward elimination, or stepwise selection can be employed to identify the most important covariates for the model. Additionally, interactions between covariates can be examined to understand if the effect of one covariate on the hazard depends on the level of another covariate. > **Note:** Cox regression can become complex with an increasing number of variables, requiring careful model building and interpretation. ## 42.2 Applications and interpretation in practice The exercises provided illustrate the practical application of Cox regression in various medical research contexts, demonstrating how to interpret findings related to age, tumor characteristics, and treatment modalities. ### 42.2.1 Breast cancer recurrence study In a study on breast cancer recurrence, several variables were analyzed using Cox regression: * **Age:** An HR of 1.69 for patients 50+ vs. <50 indicated a higher risk of recurrence in older patients. * **Tumor size:** An HR of 1.32 for tumors >2 cm vs. ≤2 cm suggested a greater risk with larger tumors. * **Chemotherapy:** An HR of 0.88 suggested a slight, non-significant reduction in recurrence risk. * **Radiation:** An HR of 0.54 indicated a significant reduction in recurrence risk with radiation therapy [790](#page=790). ### 42.2.2 Prostate cancer radiotherapy study Another application involved analyzing long-term prostate cancer control after radiotherapy. Key findings included: * **Age:** An HR of 1.02 indicated a very small, non-significant increase in hazard per year of age. * **Hormone therapy:** An HR of 0.89 was not statistically significant, suggesting no clear impact on hazard. * **Pre-PSA level:** An HR of 2.41 for PSA >10 ng/mL vs. ≤10 ng/mL indicated a significantly higher hazard of recurrence for those with higher pre-treatment PSA levels. * **Tumor classification:** An HR of 1.42 suggested a higher hazard associated with certain tumor classifications. > **Example:** For the prostate cancer study, the HR of 2.41 for pre-PSA level greater than 10 ng/mL means patients with this elevated level have approximately 2.41 times the hazard of recurrence compared to those with PSA levels of 10 ng/mL or less [794](#page=794). # 43. Survival analysis (part 4) This section delves deeper into survival analysis, focusing on advanced methods for analyzing time-to-event data beyond basic Kaplan-Meier estimates, specifically introducing Cox proportional hazards regression and advanced comparison techniques. ## 43.1 Introduction to Cox regression The Cox proportional hazards regression model is a semi-parametric model widely used in survival analysis to investigate the relationship between the survival time of a subject and one or more predictor variables (covariates). It allows for the incorporation of multiple covariates simultaneously and provides estimates of their effects on the hazard rate, while making fewer assumptions about the shape of the baseline hazard function compared to parametric models. ## 43.2 The Cox proportional hazards model The core of the Cox model is the hazard function, denoted by $h(t)$, which represents the instantaneous rate of experiencing the event of interest at time $t$, given that the subject has survived up to time $t$. The Cox model expresses the hazard for an individual with a set of covariates $x_1, x_2, \ldots, x_p$ as: $$h(t \mid x_1, \ldots, x_p) = h_0(t) \exp(\beta_1 x_1 + \beta_2 x_2 + \cdots + \beta_p x_p)$$ where: * $h_0(t)$ is the baseline hazard function, representing the hazard when all covariates are zero. This is a non-parametric component that is estimated from the data. * $\exp(\beta_1 x_1 + \beta_2 x_2 + \cdots + \beta_p x_p)$ is the relative risk or hazard ratio component, which depends on the covariates and their associated coefficients $\beta_j$. The key assumption of the Cox model is the **proportional hazards assumption**. This means that the ratio of hazards for any two individuals is constant over time. In other words, for two individuals $i$ and $k$ with covariate vectors $x_i$ and $x_k$, the hazard ratio is: $$\frac{h(t \mid x_i)}{h(t \mid x_k)} = \frac{h_0(t) \exp(\sum_{j=1}^p \beta_j x_{ij})}{\ h_0(t) \exp(\sum_{j=1}^p \beta_j x_{kj})} = \exp\left(\sum_{j=1}^p \beta_j (x_{ij} - x_{kj})\right)$$ This ratio is independent of time $t$. ### 43.2.1 Estimating coefficients in Cox regression The coefficients ($\beta_j$) in the Cox model are typically estimated using a technique called **partial likelihood maximization**. This method allows for the estimation of the $\beta$ coefficients without explicitly defining the baseline hazard function $h_0(t)$. The partial likelihood considers the set of individuals who are at risk at each event time and assesses the probability that the observed event occurred in the individual it did, given the set of covariates and the event times of all individuals at risk. ### 43.2.2 Interpretation of coefficients The coefficients $\beta_j$ represent the change in the log of the hazard ratio for a one-unit increase in the corresponding covariate $x_j$, holding all other covariates constant. More commonly, they are interpreted in terms of the hazard ratio: * A hazard ratio of $\exp(\beta_j) > 1$ indicates that an increase in $x_j$ is associated with an increased hazard (shorter survival time). * A hazard ratio of $\exp(\beta_j) < 1$ indicates that an increase in $x_j$ is associated with a decreased hazard (longer survival time). * A hazard ratio of $\exp(\beta_j) = 1$ indicates that $x_j$ has no effect on the hazard. The quantity $\exp(\beta_j)$ is the estimated hazard ratio for a one-unit increase in $x_j$. > **Important:** The interpretation of covariates can depend on their scale and meaning. For categorical covariates, $\exp(\beta_j)$ represents the hazard ratio comparing that category to the reference category. ## 43.3 Handling censoring in Cox regression The Cox regression model is robust to various types of censoring, including right-censoring, which is the most common scenario where the event of interest has not occurred for some subjects by the end of the study or due to loss to follow-up. The partial likelihood estimation inherently accounts for censored observations by including them in the risk set until the time they are censored. > **Note:** Like the Kaplan-Meier estimator, Cox regression is primarily designed for right-censored data. Special adaptations are needed for interval censoring or left-censoring. ## 43.4 Comparison of survival curves for multiple groups While the log-rank test (discussed in previous parts) is effective for comparing survival curves between two or three groups, more complex scenarios may require different approaches, especially when considering covariates. ### 43.4.1 Stratified Cox models When the proportional hazards assumption is violated for a specific categorical covariate, or when we want to analyze data from distinct subpopulations where baseline hazard functions might differ, a **stratified Cox model** can be used. In a stratified Cox model, the baseline hazard function is allowed to be different for each stratum (group defined by the categorical covariate), but the hazard ratios associated with other covariates are assumed to be the same across strata. For example, if we suspect the effect of a treatment might differ between males and females, we could stratify by sex. The model would then estimate a separate $h_0(t)$ for males and females, but the $\beta$ coefficients for other covariates would be shared. This is specified as: $$h(t \mid x, s) = h_{0,s}(t) \exp(\sum_{j=1}^p \beta_j x_j)$$ where $s$ denotes the stratum. This is particularly useful when a categorical variable does not meet the proportional hazards assumption for the overall model. ### 43.4.2 Interaction terms Another way to handle non-proportional hazards or to investigate if the effect of a covariate differs across levels of another covariate is to include **interaction terms** in the Cox model. An interaction term between a covariate $x_1$ and a categorical variable $x_2$ (e.g., treatment group) is represented as $x_1 \times x_2$. The model would then be: $$h(t \mid x_1, x_2, \ldots) = h_0(t) \exp(\beta_1 x_1 + \beta_2 x_2 + \beta_3 (x_1 \times x_2) + \cdots)$$ If the interaction term $\beta_3$ is statistically significant, it implies that the effect of $x_1$ on the hazard differs depending on the level of $x_2$, or vice versa. This allows for a more nuanced understanding of how covariates influence survival, going beyond the simple proportional hazards assumption for all effects simultaneously. > **Remember:** When using interaction terms with categorical variables, careful coding of variables (e.g., dummy coding) and interpretation of coefficients are essential. ## 43.5 Model diagnostics for Cox regression Assessing the validity of the proportional hazards assumption is crucial for interpreting Cox regression results. Various graphical and statistical methods are employed for this purpose: * **Schoenfeld residuals:** These residuals are used to test for the proportional hazards assumption for individual covariates. A plot of Schoenfeld residuals against time should show no discernible trend for the proportional hazards assumption to hold. Statistical tests based on these residuals can formally assess the assumption. * **Cumulative hazard plots:** Plotting the cumulative hazard for each covariate level can visually assess if the hazard curves are parallel. * **Time-dependent covariates:** If the proportional hazards assumption is clearly violated for a covariate, it can be modeled as a time-dependent covariate. This means its effect on the hazard changes over time, often by including an interaction term between the covariate and a function of time (e.g., $\beta_1 x_1 + \beta_2 x_1 \times \log(t)$). This approach, however, makes the model more complex [826](#page=826). > **Example:** If a new treatment's benefit (hazard reduction) diminishes over time, its hazard ratio would not be constant. Modeling it with a time-dependent covariate would capture this change, where its coefficient for the time interaction term would indicate how its effect decays. # 44. Survival analysis (part 5) This section focuses on advanced concepts and applications within survival analysis, specifically detailing the Cox proportional hazards model for analyzing time-to-event data with covariates and discussing its interpretation and diagnostic checks. ## 44.1 The Cox proportional hazards model The Cox proportional hazards (Cox PH) model is a semi-parametric regression model used to analyze the relationship between covariates and the time until an event occurs. It allows for the estimation of the effect of predictor variables on the hazard rate without assuming a specific form for the baseline hazard function. This makes it highly flexible and widely applicable in fields such as medicine, engineering, and social sciences. ### 44.1.1 Model formulation The core of the Cox PH model lies in its definition of the hazard function, $\lambda(t | \mathbf{X})$, for an individual with a vector of covariates $\mathbf{X}$:\lambda(t | \mathbf{X}) = \lambda_0(t) \exp(\mathbf{X}^T \boldsymbol{\beta})
where: * $\lambda(t | \mathbf{X})$ is the hazard rate at time $t$ for an individual with covariates $\mathbf{X}$. * $\lambda_0(t)$ is the baseline hazard function, representing the hazard rate when all covariates are zero ($\mathbf{X} = \mathbf{0}$). This function is unspecified and left non-parametric. * $\mathbf{X}$ is a vector of covariates for an individual, $\mathbf{X} = (X_1, X_2, \ldots, X_p)^T$. * $\boldsymbol{\beta}$ is a vector of regression coefficients, $\boldsymbol{\beta} = (\beta_1, \beta_2, \ldots, \beta_p)^T$, representing the effect of each covariate on the log-hazard. * $\exp(\mathbf{X}^T \boldsymbol{\beta})$ is the relative risk or hazard ratio associated with the covariates. The model assumes that the hazard rates for different individuals are proportional over time, meaning the ratio of their hazard rates is constant. This is known as the **proportional hazards assumption**. ### 44.1.2 Interpretation of coefficients The coefficients $\beta_j$ in the Cox PH model represent the change in the log-hazard for a one-unit increase in the corresponding covariate $X_j$, holding other covariates constant. More commonly, they are interpreted in terms of the hazard ratio (HR), which is $\exp(\beta_j)$. * An HR of 1 indicates no effect of the covariate on the hazard rate. * An HR greater than 1 indicates an increased hazard rate (shorter survival time) associated with the covariate. * An HR less than 1 indicates a decreased hazard rate (longer survival time) associated with the covariate. For example, if $\beta_1 = 0.5$, then $\exp(0.5) \approx 1.65$. This means that a one-unit increase in $X_1$ is associated with a 65% increase in the hazard rate, or that the hazard rate is approximately 1.65 times higher for individuals with a one-unit higher value of $X_1$, compared to those with a lower value, assuming all other covariates are constant. > **Note:** The hazard ratio $(\exp(\beta_j))$ is the multiplicative factor by which the hazard rate changes for a one-unit increase in the covariate $X_j$, assuming other covariates remain constant. ### 44.1.3 Estimation The coefficients $\boldsymbol{\beta}$ are typically estimated using **maximum partial likelihood estimation**. This method estimates $\boldsymbol{\beta}$ by maximizing a function that depends only on the ranks of the observed event times, thus avoiding the need to specify the baseline hazard function $\lambda_0(t)$. The partial likelihood function, for a sample of $n$ individuals, where $T_i$ is the observed time, $\delta_i$ is an indicator of censoring (1 if event occurred, 0 if censored), and $\mathbf{X}_i$ are the covariates for the $i$-th individual, is approximately:L(\boldsymbol{\beta}) = \prod_{i=1}^{n} \left[ \frac{\exp(\mathbf{X}i^T \boldsymbol{\beta})}{\sum{j \in R(t_i)} \exp(\mathbf{X}_j^T \boldsymbol{\beta})} \right]^{\delta_i}
where $R(t_i)$ is the risk set at time $t_i$, i.e., the set of individuals who are at risk of experiencing the event just before time $t_i$. ### 44.1.4 Checking the proportional hazards assumption A critical assumption of the Cox PH model is that the hazard ratios are constant over time. Violations of this assumption can lead to biased estimates and incorrect inferences. Several methods can be used to check this assumption: * **Graphical methods:** Plotting the log-log survival curves against time for different covariate groups can help identify non-proportionality. Another approach is to plot the Schoenfeld residuals against time; these residuals should show no systematic trend if the assumption holds. * **Statistical tests:** Formal tests, such as those based on Schoenfeld residuals or by including time-dependent covariates, can be used to assess the proportional hazards assumption. For instance, a test can be performed by including an interaction term between a covariate and a function of time (e.g., $\log(t)$) in the model. If this interaction term is statistically significant, it suggests a violation of the proportional hazards assumption for that covariate. > **Reminder:** If the proportional hazards assumption is violated for a particular covariate, one might consider stratifying the model by that covariate (if it's categorical), using time-dependent covariates, or transforming the time variable. ### 44.1.5 Inclusion of categorical covariates Categorical covariates can be incorporated into the Cox PH model by using dummy variables. If a categorical variable has $k$ levels, $k-1$ dummy variables are typically created, with one level designated as the reference category. The coefficients for these dummy variables represent the change in the log-hazard relative to the reference category. ### 44.1.6 Model diagnostics Beyond checking the proportional hazards assumption, other model diagnostics are important for assessing the overall fit and reliability of the Cox PH model: * **Influence measures:** These identify observations that unduly influence the model estimates. Techniques include examining likelihood displacement or deletion statistics for individual observations. * **Goodness-of-fit tests:** These evaluate how well the model describes the observed data. For instance, comparing the observed survival experience with that predicted by the model can be informative. ### 44.1.7 Stratified Cox models When the proportional hazards assumption is violated for a categorical covariate, but it is not meaningful to model its time-varying effect, a **stratified Cox model** can be employed. In this approach, the analysis is performed separately for each stratum (level) of the categorical covariate, allowing each stratum to have its own baseline hazard function while assuming that the coefficients for the other covariates are the same across strata. This maintains the proportionality of hazards within each stratum. > **Example:** In a study comparing two treatment groups (categorical covariate), if the survival curves diverge significantly and non-proportionally, a stratified Cox model might be used, stratifying by treatment group. This would allow for distinct baseline hazards for each treatment group while estimating a common hazard ratio for other covariates across both groups. ### 44.1.8 Extensions of the Cox model The basic Cox PH model can be extended to handle more complex scenarios: * **Time-dependent covariates:** Covariates whose values change over time for an individual. The model can be adapted by defining the hazard function to depend on the covariate's value at the specific time of observation. * **Competing risks:** When individuals can experience multiple distinct events, and the occurrence of one event precludes the occurrence of others. Specialized methods are used to estimate the cumulative incidence function for each event type, which are not directly provided by standard Cox models [848](#page=848). # 45. Survival analysis (part 6) This section delves into advanced concepts in survival analysis, focusing on methods for comparing survival distributions between groups and introducing the fundamental principles of Cox proportional hazards regression for modeling the effects of covariates on time-to-event data. ## 45.1 Comparing survival curves When analyzing time-to-event data, it is often necessary to compare survival experiences across different groups (e.g., treatment vs. control, different risk factors). The primary goal is to determine if there is a statistically significant difference in the time to event between these groups. ### 45.1.1 The log-rank test The log-rank test is a non-parametric statistical test used to compare the survival distributions of two or more independent groups. It is a widely accepted method for assessing differences in survival curves, particularly when the proportional hazards assumption is met. The test is based on comparing the observed number of events at each event time with the expected number of events under the null hypothesis that all survival curves are identical. The general principle of the log-rank test involves constructing a contingency table at each distinct event time. For a two-group comparison, this table would typically show: * **Observed events:** The number of events that actually occurred in a group. * **Expected events:** The number of events that would have been expected in that group if the null hypothesis (no difference in survival between groups) were true. The test statistic is a weighted sum of the differences between observed and expected events across all event times, with weights that typically favour earlier events. #### 45.1.1.1 Calculation of the log-rank test statistic The log-rank test statistic, often denoted as $L$, can be expressed as a sum over all distinct event times $t_j$. Let: * $d_{kj}$ be the number of events in group $k$ at time $t_j$. * $n_{kj}$ be the number of individuals at risk in group $k$ just before time $t_j$. * $D_j = \sum_k d_{kj}$ be the total number of events in all groups at time $t_j$. * $N_j = \sum_k n_{kj}$ be the total number of individuals at risk in all groups just before time $t_j$. The expected number of events in group $k$ at time $t_j$ under the null hypothesis is: $$E_{kj} = n_{kj} \frac{D_j}{N_j}$$ The log-rank test statistic for comparing $G$ groups is: $$L = \sum_{j=1}^{m} \sum_{k=1}^{G} \frac{(d_{kj} - E_{kj})^2}{E_{kj}}$$ where $m$ is the total number of distinct event times. Under the null hypothesis of no difference in survival, the statistic $L$ approximately follows a chi-squared distribution with $G-1$ degrees of freedom. > **Note:** The log-rank test is most powerful when the hazards are proportional across groups. If the hazards are not proportional, other tests might be more appropriate, or the interpretation of the log-rank test results should be cautious. ### 45.1.2 Other comparison tests While the log-rank test is the most common, other tests exist for comparing survival curves, each with different assumptions and sensitivities: * **Wilcoxon test (or Gehan test):** This test gives more weight to events that occur earlier in the follow-up period. It is generally more powerful than the log-rank test if survival curves cross, meaning the hazards are not proportional. * **Tarone-Ware test:** This is a class of tests that includes the log-rank test and Wilcoxon test as special cases. It allows for varying weights to be assigned to different time points, offering flexibility in detecting differences in survival. > **Important:** The choice of test depends on the specific research question and the expected pattern of survival differences between groups. The log-rank test assumes proportional hazards, while the Wilcoxon test is less sensitive to this assumption. ## 45.2 Introduction to Cox regression Cox proportional hazards regression is a semiparametric statistical model used to investigate the effect of one or more predictor variables (covariates) on the time to event. It is particularly useful when there are multiple factors that might influence survival, and we want to quantify their individual and combined effects while accounting for censoring. ### 45.2.1 The proportional hazards assumption The core assumption of the Cox model is that the hazard rates for individuals with different covariate values are proportional over time. The hazard rate, denoted by $h(t)$, represents the instantaneous risk of an event occurring at time $t$, given that the individual has survived up to time $t$. For a single covariate $x$, the Cox proportional hazards model is expressed as: $$h(t|x) = h_0(t) e^{\beta x}$$ Where: * $h(t|x)$ is the hazard rate for an individual with covariate value $x$ at time $t$. * $h_0(t)$ is the baseline hazard rate, which is the hazard rate when all covariates are zero. This is a non-parametric function of time and is not estimated by the model. * $e^{\beta x}$ is the exponential function of the linear combination of covariates and their coefficients. * $\beta$ is the regression coefficient for the covariate $x$. The term $e^{\beta x}$ represents the hazard ratio (HR) for a unit increase in the covariate $x$. If $x$ is a binary variable (e.g., treatment group coded as 0 or 1), $e^{\beta}$ represents the hazard ratio comparing the exposed group to the unexposed group. #### 45.2.1.1 Interpretation of the hazard ratio * If $e^{\beta} > 1$, the covariate increases the hazard rate (i.e., increases the risk of the event). * If $e^{\beta} < 1$, the covariate decreases the hazard rate (i.e., decreases the risk of the event). * If $e^{\beta} = 1$, the covariate has no effect on the hazard rate. The value of $\beta$ itself can be interpreted in terms of the natural logarithm of the hazard ratio: $\beta = \ln(HR)$. ### 45.2.2 Model fitting and interpretation The Cox model is fitted using partial likelihood maximization. This method estimates the coefficients $\beta$ without making assumptions about the shape of the baseline hazard function $h_0(t)$. When dealing with multiple covariates, the model extends to: $$h(t|x_1, x_2, \dots, x_p) = h_0(t) e^{\beta_1 x_1 + \beta_2 x_2 + \dots + \beta_p x_p}$$ The coefficients $\beta_i$ quantify the effect of each covariate $x_i$ on the hazard rate, adjusting for the effects of all other covariates in the model. The interpretation of $e^{\beta_i}$ is the hazard ratio for a one-unit increase in $x_i$, assuming all other covariates are held constant. > **Reminder:** The proportional hazards assumption is critical. If it is violated, the interpretation of the hazard ratios as constant over time can be misleading. Statistical tests and graphical methods are available to assess this assumption. This concludes part 6, which has covered methods for comparing survival curves and the foundational principles of Cox regression. Subsequent sections will likely explore the implementation and interpretation of Cox models in more detail, including assumption checking and model building strategies [868](#page=868). # 46. Survival analysis (part 7) This section delves into survival analysis, focusing on methods for analyzing time-to-event data, including the estimation of survival functions, comparison of survival distributions, and regression modeling with covariates. ## 46.1 Introduction to survival analysis Survival analysis is a branch of statistics that deals with the analysis of time-to-event data. The primary focus is on the duration of time until a specific event of interest occurs. This event could be death, disease recurrence, equipment failure, or any other outcome of interest. Key challenges in survival analysis include the presence of censored data, where the event of interest has not yet occurred for some individuals by the end of the study period. ## 46.2 Estimating survival curves The Kaplan-Meier (KM) estimator is a non-parametric method used to estimate the survival function from lifetime data. The survival function, denoted as $S(t)$, represents the probability that an individual survives beyond time $t$. The KM estimator calculates this probability at each event time, accounting for individuals who have been censored prior to that time. The KM estimate is calculated as: $$ \hat{S}(t) = \prod_{t_i \le t} \left(1 - \frac{d_i}{n_i}\right) $$ where: - $t_i$ are the distinct event times. - $d_i$ is the number of events (deaths) at time $t_i$. - $n_i$ is the number of individuals at risk (alive and uncensored) just before time $t_i$. The Kaplan-Meier curve is a step function that decreases at each event time. > **Note:** The Kaplan-Meier estimator provides a cumulative probability of survival over time and is particularly useful for visualizing the survival experience of a group. ## 46.3 Comparing survival distributions Comparing survival curves between different groups is a common task in survival analysis. The log-rank test is a widely used non-parametric statistical test for comparing two or more survival distributions. It is based on comparing the observed number of events in each group to the expected number of events if the null hypothesis (that the survival distributions are the same) were true. The log-rank test statistic is a weighted difference between observed and expected events across all event times, with weights typically chosen to give more importance to earlier events. > **Tip:** The log-rank test is most powerful when the proportional hazards assumption holds, meaning the hazard ratio between groups is constant over time. However, it can still be used as a general test for differences in survival curves. ## 46.4 Introduction to Cox regression Cox proportional hazards regression is a semi-parametric regression model used to investigate the effect of covariates on the time to event. It allows for the inclusion of multiple predictor variables (covariates) to estimate their impact on the hazard rate. The hazard rate, $h(t)$, represents the instantaneous risk of experiencing the event at time $t$, given that the individual has survived up to time $t$. The Cox model is defined as: $$ h(t|X) = h_0(t) \exp(\beta_1 X_1 + \beta_2 X_2 + \dots + \beta_p X_p) $$ where: - $h(t|X)$ is the hazard rate for an individual with covariate values $X = (X_1, X_2, \dots, X_p)$. - $h_0(t)$ is the baseline hazard function, representing the hazard when all covariates are zero. This function is unspecified and is estimated non-parametrically. - $\beta_j$ are the regression coefficients associated with each covariate $X_j$. These coefficients represent the change in the log hazard for a one-unit increase in the corresponding covariate, assuming other covariates are held constant. The exponentiated coefficient, $\exp(\beta_j)$, is known as the hazard ratio (HR). An HR greater than 1 indicates an increased hazard, while an HR less than 1 indicates a decreased hazard. > **Important:** The core assumption of the Cox model is the proportional hazards assumption, which states that the ratio of the hazards for two individuals is constant over time. This means the effect of each covariate on the hazard is independent of time [888](#page=888). # 47. Survival analysis (part 8) This section delves into survival analysis by focusing on the Kaplan-Meier estimator for survival functions, methods for comparing survival curves, and an introduction to Cox regression for modeling time-to-event data with covariates. ## 47.1 Kaplan-Meier estimator The Kaplan-Meier estimator is a non-parametric method used to estimate the survival function from observed time-to-event data. It is particularly useful when dealing with censored data, where the exact event time is unknown for some subjects. ### 47.1.1 Estimating survival probabilities The survival function, denoted as $S(t)$, represents the probability that an individual survives beyond time $t$. The Kaplan-Meier estimator calculates this probability at each observed event time. Let $n_j$ be the number of individuals at risk just before time $t_j$, and let $d_j$ be the number of events that occurred at time $t_j$. The estimated survival probability at time $t_j$ is calculated as: $$ \hat{S}(t_j) = \hat{S}(t_{j-1}) \left( 1 - \frac{d_j}{n_j} \right) $$ where $\hat{S}(t_0) = 1$. This formula indicates that the survival probability at a given time point is the product of the survival probabilities from all previous time points, adjusted by the proportion of individuals who survived past the current event time. ### 47.1.2 Handling censoring Censoring occurs when the event of interest (e.g., death, disease recurrence) has not occurred for a subject by the end of the study, or when a subject is lost to follow-up. The Kaplan-Meier estimator accounts for censored observations by only including individuals who are still at risk and under observation at each event time. > **Note:** Right censoring is the most common type in survival analysis, where the event has not occurred by the end of the observation period. ## 47.2 Comparing survival curves When analyzing survival data, it is often necessary to compare survival experiences between different groups (e.g., treatment vs. control). The log-rank test is a widely used non-parametric statistical test for comparing two or more survival curves. ### 47.2.1 The log-rank test The log-rank test assesses whether there is a statistically significant difference in survival distributions between groups. It operates by comparing the observed number of events in each group to the expected number of events, assuming the null hypothesis of no difference in survival distributions. The test statistic for the log-rank test is typically calculated based on the differences between observed and expected event counts across all time points where events occur. A larger test statistic indicates a greater divergence between the survival curves. #### Null hypothesis: $H_0$: The survival distributions for all groups are identical. $H_1$: At least one group has a different survival distribution. #### Interpretation: A small p-value (typically $< 0.05$) from the log-rank test suggests that the observed differences in survival curves are unlikely to be due to random chance, leading to the rejection of the null hypothesis. > **Tip:** The log-rank test is sensitive to differences in survival at all time points. If the differences are concentrated at specific times, other tests might be more powerful. ## 47.3 Introduction to Cox regression Cox proportional hazards regression is a semi-parametric model used to investigate the relationship between the survival time of a dependent variable and one or more predictor variables (covariates). A key assumption of this model is the proportional hazards assumption. ### 47.3.1 The proportional hazards model The Cox proportional hazards model estimates the hazard rate, which is the instantaneous rate of experiencing the event at a given time, conditional on survival up to that time. The model is expressed as: $$ h(t | \mathbf{x}) = h_0(t) \exp(\mathbf{\beta}^T \mathbf{x}) $$ where: - $h(t | \mathbf{x})$ is the hazard rate at time $t$ for an individual with covariate vector $\mathbf{x}$. - $h_0(t)$ is the baseline hazard function, representing the hazard when all covariates are zero. - $\mathbf{x}$ is a vector of predictor variables. - $\mathbf{\beta}$ is a vector of regression coefficients that quantify the effect of each covariate on the hazard rate. #### Proportional hazards assumption: The proportional hazards assumption states that the ratio of hazard rates between two individuals with different covariate values remains constant over time. This means the effect of a covariate is multiplicative on the baseline hazard and does not change with time. #### Interpretation of coefficients: The coefficients ($\beta_i$) in the Cox model represent the change in the log hazard ratio associated with a one-unit increase in the corresponding covariate ($x_i$), holding other covariates constant. The hazard ratio (HR) for a covariate $x_i$ is given by $\exp(\beta_i)$. - An HR > 1 indicates an increased hazard (shorter survival). - An HR < 1 indicates a decreased hazard (longer survival). - An HR = 1 indicates no effect on the hazard. > **Example:** If a covariate is `treatment = 1` (for treatment group) and `treatment = 0` (for control group), and the estimated coefficient $\beta_{\text{treatment}}$ is $0.693$, then the hazard ratio is $\exp(0.693) \approx 2$. This implies that individuals in the treatment group have twice the hazard of experiencing the event compared to the control group, assuming proportional hazards. ### 47.3.2 Applications of Cox regression Cox regression is versatile and can be used for: - Assessing the impact of prognostic factors on survival. - Adjusting for confounding variables when comparing treatment effects. - Predicting survival probabilities for individuals with specific characteristics. The model estimates the coefficients ($\beta$) using partial likelihood estimation, which does not require specifying the form of the baseline hazard function $h_0(t)$. # 48. Survival analysis (part 9) This section delves into survival analysis, focusing on methods to analyze time-to-event data, including estimating survival functions, comparing survival curves, and modeling with covariates. ## 48.1 Introduction to survival analysis Survival analysis is a branch of statistics that deals with the analysis of time-to-event data. This type of data involves measuring the time until a specific event of interest occurs. Common examples include the time until death, the time until disease recurrence, or the time until equipment failure. A critical aspect of survival analysis is handling "censored" data, where the event of interest has not yet occurred for some subjects by the end of the observation period. ## 48.2 Kaplan-Meier estimator The Kaplan-Meier estimator is a non-parametric statistical method used to estimate the survival function from lifetime data. It is particularly useful when dealing with censored data. ### 48.2.1 Estimating the survival function The survival function, denoted as $S(t)$, represents the probability that an individual survives beyond a specific time $t$. The Kaplan-Meier estimator constructs a step-wise estimate of this function. It calculates the probability of survival at each time point where an event occurs, taking into account the number of individuals at risk and the number of events. The formula for the Kaplan-Meier estimator $\hat{S}(t)$ is: $$ \hat{S}(t) = \prod_{t_i \le t} \left(1 - \frac{d_i}{n_i}\right) $$ where: - $t_i$ are the distinct times at which events occur. - $d_i$ is the number of events (deaths or other specified events) at time $t_i$. - $n_i$ is the number of individuals at risk just before time $t_i$. > **Note:** The product is taken over all event times $t_i$ that are less than or equal to the time $t$ for which the survival probability is being estimated. ## 48.3 Comparing survival curves When analyzing the effect of different treatments or exposures on survival time, it is often necessary to compare survival curves between groups. The log-rank test is a common non-parametric statistical test used for this purpose. ### 48.3.1 The log-rank test The log-rank test compares the survival experience of two or more groups. It assesses whether there is a statistically significant difference between the survival distributions of these groups. The test is based on comparing the observed number of events in each group to the expected number of events if the null hypothesis of no difference in survival curves were true. > **Tip:** The log-rank test is generally more powerful than other methods, such as the Wilcoxon test, when the differences in survival curves are spread out over time. ## 48.4 Introduction to Cox regression Cox proportional hazards regression is a semi-parametric statistical model used to investigate the effect of predictor variables on the hazard rate of an event occurring. It is a fundamental tool for modeling time-to-event data when covariates are involved. ### 48.4.1 The Cox proportional hazards model The hazard function, $h(t)$, represents the instantaneous risk of an event occurring at time $t$, given that the individual has survived up to time $t$. The Cox model assumes that the hazard rate for an individual is a function of their covariates: $$ h(t | \mathbf{x}) = h_0(t) \exp(\beta_1 x_1 + \beta_2 x_2 + \dots + \beta_p x_p) $$ where: - $h(t | \mathbf{x})$ is the hazard rate for an individual with covariate vector $\mathbf{x}$ at time $t$. - $h_0(t)$ is the baseline hazard function, representing the hazard when all covariates are zero. This function is unspecified and can take any form. - $\mathbf{x} = (x_1, x_2, \dots, x_p)$ is the vector of $p$ covariates for the individual. - $\beta = (\beta_1, \beta_2, \dots, \beta_p)$ is the vector of regression coefficients, which quantify the effect of each covariate on the hazard rate. The term $\exp(\beta_1 x_1 + \dots + \beta_p x_p)$ is often referred to as the hazard ratio (HR) relative to the baseline hazard. A covariate with a positive coefficient $\beta_j$ increases the hazard rate, while a negative coefficient decreases it. > **Example:** In a medical study, if a covariate $x_1$ represents age and its coefficient $\beta_1$ is positive, it suggests that older individuals have a higher risk of the event of interest (e.g., disease occurrence) compared to younger individuals, holding other covariates constant. # 49. Survival analysis (part 10) This section delves into survival analysis, focusing on methods for analyzing time-to-event data, including estimating survival probabilities, comparing survival distributions between groups, and modeling the impact of covariates on survival times. ## 49.1 Understanding time-to-event data and censoring Survival analysis is a branch of statistics used to analyze data where the outcome of interest is the time until a specific event occurs. This event can be diverse, such as death, disease recurrence, equipment failure, or customer churn. A key challenge in survival analysis is the presence of **censoring**, which occurs when the event of interest has not occurred for some individuals by the end of the study period, or when they are lost to follow-up. * **Time-to-event data:** This data consists of two components: * The time elapsed until the event occurs (or censoring). * An indicator variable denoting whether the event occurred (event) or if the observation is censored. * **Types of censoring:** * **Right-censoring:** The most common type, where the event has not occurred by the end of the observation period or the individual is lost to follow-up. The exact survival time is unknown but is at least as long as the observed time. * **Left-censoring:** The event has already occurred before the observation begins, but the exact time of occurrence is unknown. * **Interval-censoring:** The event is known to have occurred within a specific time interval, but the exact time is not known. > **Note:** Understanding censoring is crucial because ignoring it can lead to biased estimates of survival probabilities, typically underestimating true survival. ## 49.2 Estimating survival curves with the Kaplan-Meier procedure The **Kaplan-Meier (KM) estimator** is a non-parametric method used to estimate the survival function from time-to-event data. It provides a step-function estimate of the probability of survival over time, accounting for censored observations. The survival function, denoted as $S(t)$, represents the probability that an individual survives beyond time $t$. The KM estimator is calculated at each distinct event time $t_i$. The formula for the Kaplan-Meier estimator is: $$ \hat{S}(t) = \prod_{t_i \le t} \left(1 - \frac{d_i}{n_i}\right) $$ Where: * $t_i$ is the $i$-th distinct time at which an event occurs. * $d_i$ is the number of events (deaths) at time $t_i$. * $n_i$ is the number of individuals at risk just before time $t_i$ (i.e., those who have not yet experienced the event or been censored). > **Important:** The Kaplan-Meier curve is a product of conditional probabilities. At each event time, the probability of surviving that interval is multiplied by the survival probability estimated up to that point. The output typically includes a table of survival estimates at various time points, along with confidence intervals. These curves are visually represented as step functions, dropping at each observed event time. ## 49.3 Comparing survival curves using log-rank tests When comparing survival experiences between two or more groups (e.g., treatment vs. control), the **log-rank test** is a common non-parametric statistical test. It assesses whether there is a statistically significant difference in the survival distributions of these groups. The log-rank test is a powerful method because it accounts for both the timing and number of events in each group, and it can handle different numbers of censored observations. The null hypothesis for the log-rank test is that the survival distributions for all groups are identical. The test statistic is based on comparing the observed number of events in each group to the expected number of events, assuming the null hypothesis is true. > **Tip:** The log-rank test is sensitive to differences in survival at all time points. Other tests, like the Wilcoxon (Breslow) test, give more weight to earlier events, which can be useful if early survival differences are of primary interest. ## 49.4 Introduction to Cox regression for modeling survival data with covariates While Kaplan-Meier curves and log-rank tests are useful for descriptive and comparative analyses, they do not easily incorporate the influence of multiple covariates simultaneously. The **Cox proportional hazards (PH) model** is a semi-parametric regression model that addresses this by estimating the effect of one or more predictor variables (covariates) on the hazard rate. The hazard function, $h(t)$, represents the instantaneous rate of experiencing the event at time $t$, given that the individual has survived up to time $t$. The Cox model assumes that the hazard rate for an individual can be modeled as: $$ h(t; \mathbf{x}) = h_0(t) \exp(\beta_1 x_1 + \beta_2 x_2 + \dots + \beta_p x_p) $$ Where: * $h_0(t)$ is the baseline hazard function, representing the hazard when all covariates are zero. It is left unspecified, making the model semi-parametric. * $\mathbf{x} = (x_1, x_2, \dots, x_p)$ are the predictor variables (covariates). * $\boldsymbol{\beta} = (\beta_1, \beta_2, \dots, \beta_p)$ are the regression coefficients, representing the change in the log-hazard ratio associated with a one-unit increase in the corresponding covariate. The exponentiated coefficients, $\exp(\beta_j)$, are called **hazard ratios (HRs)**. * An HR > 1 indicates an increased hazard (reduced survival) associated with an increase in the covariate. * An HR < 1 indicates a decreased hazard (increased survival) associated with an increase in the covariate. * An HR = 1 indicates no effect of the covariate on the hazard. > **Crucial Assumption:** The Cox model relies on the **proportional hazards assumption**, which states that the hazard ratio between any two individuals remains constant over time. This assumption should be tested before interpreting the model results. The output from a Cox regression analysis typically includes the estimated coefficients ($\beta$), their standard errors, $z$-scores (or Wald statistics), $p$-values, and the hazard ratios with their confidence intervals. These results help identify which covariates are significant predictors of the hazard rate and quantify their impact. # 50. Survival analysis (part 11) This section introduces survival analysis, focusing on analyzing time-to-event data, handling censored observations, estimating survival functions, and modeling these outcomes using regression techniques. ## 50.1 Time-to-event data and censoring Survival analysis is concerned with the analysis of time-to-event data, where the "event" can be any outcome of interest, such as death, disease recurrence, equipment failure, or customer churn. A key characteristic of such data is **censoring**, which occurs when the event of interest has not occurred for all subjects by the end of the study period, or when a subject is lost to follow-up before the event occurs. This partial information about the time to event is known as **censored survival time**. * **Types of censored data:** * **Right-censoring:** The most common type, where the observation period ends before the event occurs. * **Left-censoring:** The event is known to have occurred before a certain time point, but the exact time is unknown. * **Interval-censoring:** The event is known to have occurred within a specific interval of time. > **Note:** Understanding and properly accounting for censoring is crucial for obtaining unbiased estimates of survival probabilities and hazard rates. Ignoring censoring can lead to underestimation of the true survival times. ## 50.2 Kaplan-Meier procedure The **Kaplan-Meier procedure**, also known as the product-limit method, is a non-parametric statistical method used to estimate the survival function from time-to-event data. It handles censored observations by adjusting the survival probability at each event time based on the number of individuals still at risk. The survival function, denoted as $S(t)$, represents the probability of an individual surviving beyond time $t$. The core idea is to calculate the probability of surviving each interval between observed event times. For each time point $t_i$ where an event occurs, the estimated survival function is updated by multiplying the previous estimate by the proportion of individuals who survived that interval. * **Key components of the Kaplan-Meier procedure:** * **Time points:** All distinct times at which events or censoring occur. * **Number at risk ($n_i$):** The number of individuals who have not yet experienced the event and are still under observation just before time $t_i$. * **Number of events ($d_i$):** The number of events that occur exactly at time $t_i$. * **Estimated survival probability ($ \hat{S}(t_i) $):** The probability of surviving up to time $t_i$. The formula for the estimated survival function at time $t_k$ is: $$ \hat{S}(t_k) = \prod_{i=1}^{k} \left(1 - \frac{d_i}{n_i}\right) $$ where the product is taken over all distinct event times $t_i$ up to $t_k$. > **Example:** If at time 5 years, there were 100 individuals at risk and 5 deaths, the probability of surviving past 5 years, given survival up to that point, would be $(1 - 5/100) = 0.95$. If the survival probability at 4 years was $0.80$, the estimated survival probability at 5 years would be $0.80 \times 0.95 = 0.76$. ## 50.3 Comparing survival curves Comparing survival curves from different groups is essential for determining if there are significant differences in survival experiences. The **log-rank test** is a widely used non-parametric statistical test for comparing two or more survival curves. It is a generalization of the Wilcoxon rank-sum test and is particularly powerful when the proportional hazards assumption holds. The log-rank test compares the observed number of events in each group to the expected number of events under the null hypothesis of no difference in survival distributions. It assigns more weight to earlier events compared to the Wilcoxon test. * **Null Hypothesis ($H_0$):** The survival distributions for all groups are identical. * **Alternative Hypothesis ($H_1$):** At least one survival distribution differs from the others. The test statistic for the log-rank test is typically based on the difference between observed and expected event counts, standardized by an estimate of its variance. ## 50.4 Introduction to Cox regression The **Cox proportional hazards model**, also known as Cox regression, is a semi-parametric statistical model used to investigate the effect of covariates on the time-to-event outcome. It is particularly useful when dealing with multiple predictor variables and when the exact form of the baseline hazard function is unknown. The model estimates the **hazard function**, $h(t)$, which represents the instantaneous rate of experiencing the event at time $t$, given that the individual has survived up to time $t$. The core assumption of the Cox model is the **proportional hazards assumption**, which states that the ratio of the hazard functions for any two individuals is constant over time and depends only on the values of their covariates. The hazard function in the Cox model is expressed as: $$ h(t|X) = h_0(t) \exp(\beta_1 X_1 + \beta_2 X_2 + \dots + \beta_p X_p) $$ or more compactly: $$ h(t|X) = h_0(t) \exp(\mathbf{\beta}^T \mathbf{X}) $$ where: * $h(t|X)$ is the hazard rate for an individual with covariate vector $X$ at time $t$. * $h_0(t)$ is the **baseline hazard function**, representing the hazard rate when all covariates are zero. * $X_1, X_2, \dots, X_p$ are the predictor variables (covariates). * $\beta_1, \beta_2, \dots, \beta_p$ are the regression coefficients, which quantify the effect of each covariate on the hazard rate. * $\exp(\beta_j X_j)$ represents the relative hazard associated with covariate $j$. A positive $\beta_j$ indicates an increased hazard (shorter survival), while a negative $\beta_j$ indicates a decreased hazard (longer survival). > **Important:** The coefficients $\beta_j$ are estimated using partial likelihood, which allows for the estimation of the covariate effects without specifying the form of the baseline hazard function $h_0(t)$ [956](#page=956). ## Common mistakes to avoid - Review all topics thoroughly before exams - Pay attention to formulas and key definitions - Practice with examples provided in each section - Don't memorize without understanding the underlying concepts© 2026 Maeve. All rights reserved. This content is protected by copyright.