Exploring Data - Notes
Data Analysis: Making Sense of Data
Statistics is the science of data, Data analysis involves organizing, displaying, and summarizing data, as well as posing questions about the data.
Individuals: Objects described by a set of data.
Variable: A characteristic of an individual.
Categorical Variable: Places an individual into a group or category.
Quantitative Variable: Takes numerical values where finding an average makes sense.
A variable takes on different values, and it's important to know how often it takes each value.
Distribution: Indicates what values a variable takes and how often it takes those values.
Exploring data involves examining each variable individually and then studying relationships between variables, starting with graphs and numerical summaries.
Population: The entire group of individuals about which we want information.
Sample: A subset of the population from which we collect data.
Data analysis leads to inference, which is making a conclusion about a population based on sample data, keeping probability in mind.
A dataset contains information on individuals, with values for one or more variables.
Variables can be categorical or quantitative.
The distribution of a variable describes the values it takes and how often.
Inference is drawing a conclusion about a population based on a sample dataset.
Analyzing Categorical Data
Categorical variables classify individuals into groups or categories.
Frequency Table: Shows the count of stations for different formats (e.g., Adult Contemporary, Country).
Relative Frequency Table: Shows the percent of stations for different formats.
Frequency tables can be hard to read so analyzing a distribution with bar graph or pie chart can be easier
Bar graphs compare quantities using bar heights.
When creating bar graphs, ensure the bars are equally wide to prevent visual deception.
Avoid replacing bars with pictures (pictographs) as they can be misleading
Pay attention to the scales on graphs, as they can be manipulated to misrepresent data.
Two-Way Table: Describes two categorical variables by organizing counts according to row and column variables.
Marginal Distribution: The distribution of values of one variable among all individuals in the table. Displaying marginal distribution using percents are more informative than counts, especially when dealing with groups of different sizes.
Examine a marginal distribution by calculating the distribution in percents for row or column totals and graphing it.
Conditional Distribution: Describes the values of a variable among individuals with a specific value of another variable.
Examine or compare conditional distributions by selecting rows or columns of interest.
Use table data to calculate the distribution in percents for the rows or columns.
Use side-by-side or segmented bar graphs to compare distributions.
Association between two categorical variables can be influenced by lurking variables.
Determining association requires formal inference methods.
Describing Location in a Distribution
Percentile: The pth percentile is the value with percent of the observations less than it.
Cumulative Relative Frequency Graph: Displays the cumulative relative frequency of each class of a frequency distribution.
Z-score (Standardized Score): Tells how many standard deviations from the mean an observation falls, and in what direction.
Formula:
Transforming Data: Converts original observations from the original units of measurements to another scale.
Adding the same number to (or subtracting from) each observation:
Adds to (or subtracts from) measures of center and location (mean, median, quartiles, percentiles).
Does not change the shape of the distribution or measures of spread (range, IQR, standard deviation).
Multiplying (or dividing) each observation by the same number :
Multiplies (or divides) measures of center and location (mean, median, quartiles, percentiles) by .
Multiplies (or divides) measures of spread (range, IQR, standard deviation) by .
Does not change the shape of the distribution.
Density Curves and Normal Distributions
Density Curve: A curve that is always on or above the horizontal axis and has an area of exactly 1 underneath it.
Describes the overall pattern of a distribution.
The area under the curve above any interval is the proportion of observations in that interval.
Median of a Density Curve: The equal-areas point, dividing the area under the curve in half.
Mean of a Density Curve: The balance point, where the curve would balance if made of solid material.
For symmetric density curves, the mean and median are the same and lie at the center.
For skewed curves, the mean is pulled away from the median in the direction of the long tail.
( \mu ) represents the mean of a density curve.
( \sigma ) represents the standard deviation of a density curve.
Normal Distributions: Described by Normal curves; symmetric, single-peaked, and bell-shaped.
Completely described by its mean ( \mu ) and standard deviation ( \sigma ).
Denoted as N(( \mu, \sigma )).
Normal distributions are important because:
Good descriptions for real data distributions.
Good approximations of chance outcome results.
Many statistical inference procedures are based on them.
The 68-95-99.7 Rule:
Approximately 68% of observations fall within ( \sigma ) of ( \mu ).
Approximately 95% of observations fall within 2( \sigma ) of ( \mu ).
Approximately 99.7% of observations fall within 3( \sigma ) of ( \mu ).
Standard Normal Distribution: Normal distribution with mean 0 and standard deviation 1; denoted as N(0,1).
If variable has distribution N(( \mu, \sigma )), then the standardized variable has the standard Normal distribution N(0,1).
Standard Normal Table (Table A): Provides areas under the standard Normal curve to the left of .
To find areas in any Normal distribution:
State distribution and values of interest; draw a Normal curve with the area of interest shaded.
Calculate -scores and use Table A or technology (normalcdf command) to find the desired area.
Answer the question in context.
To find values from areas in any Normal distribution:
State distribution and values of interest; draw a Normal curve with the area of interest shaded.
Use Table A or technology (invNorm command) to find the value of with the indicated area and unstandardize to transform back to the original distribution.
Answer the question in context.
Assessing Normality: Normal probability plots assess whether a dataset follows a Normal distribution.
If points lie close to a straight line, the data are Normal.
Systematic deviations indicate a non-Normal distribution.
Outliers appear as points far from the overall pattern.
Scatterplots and Correlation
Response Variable: Measures an outcome of a study.
Explanatory Variable: Helps explain or influence changes in a response variable.
A scatterplot displays the relationship between two quantitative variables measured on the same individuals.
The eXplanatory variable goes on the X-axis!
Label and scale your axes.
Plot individual data values.
Describe scatterplots by:
Direction: Positive or negative association.
Form: Linear, curved, etc.
Strength: How closely the points fit the form.
Outliers: Values falling outside the overall pattern.
Two variables have a positive association when above-average values of one tend to accompany above-average values of the other, and below-average values also tend to occur together.
Two variables have a negative association when above-average values of one tend to accompany below-average values of the other.
Correlation (r): Measures the direction and strength of the linear relationship between two quantitative variables.
( -1 \leq r \leq 1 )
r>0 indicates a positive association.
r<0 indicates a negative association.
Values of r near 0 indicate a very weak linear relationship.
Formula for calculating the correlation r:
Cautions:
Correlation requires that both variables be quantitative.
Correlation does not describe curved relationships between variables, no matter how strong the relationship is.
Correlation is not resistant; r is strongly affected by a few outlying observations.
Correlation is not a complete summary of two-variable data.
Least-Squares Regression
A regression line is a line that describes how a response variable y changes as an explanatory variable x changes
Regression Line Equation: ( \hat{y} = a + bx )
( \hat{y} ): predicted value of response variable.
b: slope, the amount by which y is predicted to change when x increases by one unit.
a: y-intercept, the predicted value of y when x = 0.
Extrapolation: Use of a regression line for prediction far outside the interval of values of the explanatory variable x used to obtain the line.
Residual: The difference between an observed value of the response variable and the value predicted by the regression line.
residual = observed y – predicted y
residual = y - ŷ
The least-squares regression line of y on x is the line that makes the sum of the squared residuals as small as possible.
Residual Plot: A scatterplot of the residuals against the explanatory variable.
Standard Deviation of the Residuals (s): Gives the approximate size of a “typical” prediction error (residual).
Coefficient of Determination (r^2): The fraction of the variation in the values of y that is accounted for by the least-squares regression line of y on x.
Least-squares regression line calculation:
Slope:
Intercept:
Correlation and regression lines describe only linear relationships.
Correlation and least-squares regression lines are not resistant.
Outlier: An observation that lies outside the overall pattern of the other observations.
Influential Observation: An observation is influential for a statistical calculation if removing it would markedly change the result of the calculation.
Conditional Probability and Independence
Conditional Probability: The probability of an event occurring given that another event has already occurred.
Notation: P(B | A) - the probability of event B happening given that event A has happened.
Calculating Conditional Probabilities:
General Multiplication Rule: The probability that events A and B both occur.
Tree Diagrams: Used to model a chance process involving multiple events.
Independent Events: Events for which the occurrence of one does not change the probability that the other event will happen.
Events A and B are independent if and .
Multiplication rule for independent events:
If A and B are independent events, then the probability that A and B both occur is .