Docsity

Regression Analysis: Understanding Linear Relationships and Predictions - Prof. Dan Spitzn, Study notes of Data Analysis & Statistical Methods

Toggle sidebar
bg1
STAT 2120, Notes on Topic 2, Spring 2010
Least-squares regression:
• A regression line describes a one-way linear
relationship between variables.
o An explanatory variable, , “explains”
variability in a response variable, .
o Often one wants to predict from a given .
Such a prediction is denoted .
• The least-squares regression line makes the sum
of squared-prediction errors as small as possible.
o A prediction error is the vertical distance
between a given point and a regression line.
o The formula for the least-squares regression
line is =
+
, with “slope”
=
and “intercept”
= −
. Predictions are
made by plugging in values of .
o Slope,
, is the amount of change in when
increases by one unit. Intercept,
, is the
prediction at = 0.
o Calculate
and
by computer.
• Properties of the least-squares regression line:
o Interchanging and modifies the
formulation.
o The line =
+
always passes through
the point , .
o The slope formula
=
interprets the
relationship in units of
and
through .
o Similarly,
measures the proportion of
variability in that is explained by .
• The residuals describe the leftover variation in
after fitting the least-squares regression line.
o Each residual is defined by − .
o The average of the residuals is zero.
o Analysis of residuals helps to assess the
suitability of a linear relationship.
o A residual plot is a scatterplot of residuals
against the values of .
o The ideal residual plot should exhibit no
systematic pattern; patterns indicating a
departure from the linear relationship are:
curvature, trends in spread, outliers in the
residuals.
o An outlier in corresponds with an outlier in
the residuals. Such is observed as an
observation that outside of the overall pattern
of the relationship.
• Influential observations are those whose
individual deletion would have a strong impact
on the regression line.
o An influential observation is often an outlier in
, but may not be an outlier in
.
Cautions about correlation and regression:
• Basic cautions:
o Correlation is for two-way relationships,
regression for one-way relationships.
o Only relevant for linear relationships.
o Neither is resistant.
• Extrapolation is when predictions are made
outside the range of data.
o Often untrustworthy since the linear
relationship may not hold for -values far
outside those observed.
• Correlation calculated on “averaged” data is
higher than that calculated on individuals.
• The relationship between two variables may be
influenced by a third, “lurking” variable that is
not observed.
o Lurking variables may influence relationships
between any type of variables, quantitative or
categorical.
• Association is not causation.
o An observed association may reflect the
influence of a causal lurking variable. Such is
called a “nonsense correlation.”
o An experiment that controls lurking variables
is best for establishing causation.
o It is possible to establish causation without
performing an experiment that controls for
lurking variables, but the evidence that arises
is weaker.
Relationships in categorical data:
• Relationships in categorical data are explored by
compiling variables in two-way tables.
o A two-way table involves a row variable and a
column variable.
o A two-way table may record counts or
percentages. Percentages are most useful
because they are easy to compare in the form
of distributions.
• Relationships are described through specialized
distributions appearing in the table.
o Bar graphs provide a useful means of
presenting the relevant distributions.
o The distributions of the row and column
variables appear in the margins of the table,
and are called marginal distributions. Given as
counts they are called row and column totals.
o A conditional distribution is calculated from
the counts of one variable limited to a given
category of the other variable.
pf3

Partial preview of the text

Download Regression Analysis: Understanding Linear Relationships and Predictions - Prof. Dan Spitzn and more Study notes Data Analysis & Statistical Methods in PDF only on Docsity!

STAT 2120, Notes on Topic 2, Spring 2010

Least-squares regression:

  • A regression line describes a one-way linear relationship between variables. o An explanatory variable, ᡶ, “explains” variability in a response variable, ᡷ. o Often one wants to predict ᡷ from a given ᡶ. Such a prediction is denoted ᡷ㕈.
  • The least-squares regression line makes the sum of squared-prediction errors as small as possible. o A prediction error is the vertical distance between a given point and a regression line. o The formula for the least-squares regression line is ᡷ㕈 = ᡔ⡨ + ᡔ⡩ᡶ, with “slope” ᡔ⡩ = ᡰ

う㌀ う㊙ and “intercept” ᡔ⡨ = ᡷ㍤ − ᡔ⡩ᡶ̅. Predictions are made by plugging in values of ᡶ. o Slope, ᡔ⡩, is the amount of change in ᡷ㕈 when ᡶ increases by one unit. Intercept, ᡔ⡨, is the prediction at ᡶ = 0. o Calculate ᡔ⡨ and ᡔ⡩ by computer.

  • Properties of the least-squares regression line: o Interchanging ᡶ and ᡷ modifies the formulation. o The line ᡷ㕈 = ᡔ⡨ + ᡔ⡩ᡶ always passes through the point 䙦ᡶ̅, ᡷ㍤䙧. o The slope formula ᡔ⡩ = ᡰ う㌀ う㊙^ interprets the relationship in units of ᡱけ and ᡱげ through ᡰ. o Similarly, ᡰ⡰^ measures the proportion of variability in ᡷ that is explained by ᡶ.
  • The residuals describe the leftover variation in ᡷ after fitting the least-squares regression line. o Each residual is defined by ᡷ − ᡷ㕈. o The average of the residuals is zero. o Analysis of residuals helps to assess the suitability of a linear relationship. o A residual plot is a scatterplot of residuals against the values of ᡶ. o The ideal residual plot should exhibit no systematic pattern; patterns indicating a departure from the linear relationship are: curvature, trends in spread, outliers in the residuals. o An outlier in ᡷ corresponds with an outlier in the residuals. Such is observed as an observation that outside of the overall pattern of the relationship.
  • Influential observations are those whose individual deletion would have a strong impact on the regression line. o An influential observation is often an outlier in ᡶ, but may not be an outlier in ᡷ.

Cautions about correlation and regression:

  • Basic cautions: o Correlation is for two-way relationships, regression for one-way relationships. o Only relevant for linear relationships. o Neither is resistant.
  • Extrapolation is when predictions are made outside the range of data. o Often untrustworthy since the linear relationship may not hold for ᡶ-values far outside those observed.
  • Correlation calculated on “averaged” data is higher than that calculated on individuals.
  • The relationship between two variables may be influenced by a third, “lurking” variable that is not observed. o Lurking variables may influence relationships between any type of variables, quantitative or categorical.
  • Association is not causation. o An observed association may reflect the influence of a causal lurking variable. Such is called a “nonsense correlation.” o An experiment that controls lurking variables is best for establishing causation. o It is possible to establish causation without performing an experiment that controls for lurking variables, but the evidence that arises is weaker. Relationships in categorical data:
  • Relationships in categorical data are explored by compiling variables in two-way tables. o A two-way table involves a row variable and a column variable. o A two-way table may record counts or percentages. Percentages are most useful because they are easy to compare in the form of distributions.
  • Relationships are described through specialized distributions appearing in the table. o Bar graphs provide a useful means of presenting the relevant distributions. o The distributions of the row and column variables appear in the margins of the table, and are called marginal distributions. Given as counts they are called row and column totals. o A conditional distribution is calculated from the counts of one variable limited to a given category of the other variable.

o An association may be described by examining the conditional distributions of one variable across the categories of the other variable. Typically, the former would be the response variable and the latter the explanatory variable.

  • Lurking variables may give rise to Simpson’s paradox: patterns seen in individual categories are reversed in the patterns of the combined data. Introduction to producing data:
  • Designing the production of data allows data analysis to be used for statistical inference. o Data are produced on a small scale, and the intent is to generalize to a wider scale. o Among the ways that data may be produced are taking a sample, or performing an experiment.
  • Confounding arises between explanatory variables when their relationships with the response are indistinguishable.
  • In an observaDesigning sampletional study, individuals are observed, but no attempt is made to control the conditions of data-production. o Observational studies are often plagued by confounding between an observed variable and an unobserved lurking variable.
  • In an experiment, the conditions of data- production are controlled by applying treatments to individuals. o One objective in designing an experiment is to avoid confounding between explanatory variables. Designing a sample:
  • The key elements of a sampling study: o A population is a collection of individuals about which we want information and the conclusions of statistical inference are to be relevant. o A sample is the subset of a population on which data are measured and put to analysis. o The design of a sample refers to the method used to select it from the population.
  • A sampling design is biased if it systematically favors certain portions of the population over others.
  • Examples of biased sampling designs: o A voluntary sample arises when individuals are self-selected for the sample by responding to an incentive. o A convenience sample arises when selection for the sample is determined by the convenience of the selection-maker. - Simple random sampling (SRS) selects a sample randomly, in such a way that every fixed-size subset has an equal probability of being selected. o Bias is avoided in SRS by its use of chance. o SRS may be carried out by drawing labels from a hat, or by simulating that procedure with computer software or a table of random digits. - A probability sample is a sample selected by chance (through the use of probability sampling), based on known selection probabilities of each sample. o SRS is an example of unbiased probability sampling. o In general, bias may be accommodated in probability sampling using knowledge of the selection probabilities. o Stratified random sampling is an example of probability sampling in which simple random samples are drawn in distinct strata and aggregated. o Multistage sampling is an example of probability sampling that is carried out in stages. At each stage, each in a current list of sampling units is narrowed to a list of more refined sampling units, and a SRS of those units is selected. The final list of sampling units is of individuals. - Bias in sampling may originate from sources other than the sampling design, including: o Under-coverage in the list of individuals in the population. o Non-response of individuals selected for the sample. o Inaccurate responses of the respondent, which leads to response bias. This may be unintentionally encouraged by the interviewer. o Poor wording and design of a questionnaire. Designing experiments: - In an experiment, a response variable is observed under controlled conditions that reflect carefully chosen values of explanatory variables. - Terminology associated with experiments is: o Individuals are referred to as subjects. o Explanatory variables are referred to as factors. o Each specific value of an explanatory variable is referred to as the level of a factor. It reflects the application of a treatment used to modify the experimental conditions in a specific way. - Experiments provide: focus on interesting treatments by holding uninteresting factors steady; simultaneous study of multiple factors.