1/30
Looks like no tags are added yet.
responce vs predictor variable
Response: aka dependent variable is the measured result of a test
Predictor variables: aka the explanatory or independent variables are what is used to predict/explain or cause the change in the response variable
can either be deliberately changed or naturally changed
what does regression differ from a t-test
A t-test aims to determine if the results from two groups, between two groups or between a group and a given value are different
Regression looks to see just how one variable affects the other variable, or if one variable can be used to predict the outcome of another variable
what is regression
A method used to determine the relationship between the response variable and 1 or more predictor variables
Only look at one response that will always be numeric
One numeric predictor
Describing the association between 1 numeric variable and the response variable
correlation cal be calculated in R to determine the relationship or can be observed using a scatter plot
what is a regression line
A line of best fit is used to show the overall trend of the data
Can be non-linear, but only focusing on linear in this course
looks at the distance between the line and data points in the y direction
what is the equation for a one nuemric regression line
y = b0 + b1x
x = predictor variable
y = response variable for the corresponding predictor
b1 = slope or how much y changes in response to x
b0 = intercept or the value of y when x = 0
how to interpret the intercept
if the <predictor> is 0 <units> then we expect the mean value of the <response> to be <b0> <units>
how to interpret the slope
if the <predictor> increases by 1 <unit> then we expect the mean value of the <response> to <increase/decrease> by <b1> <units>
what does it mean to fit a regression line
means finding the slope and intercept that make the distance between the line of best fit and the data pointd as small as possible
done using R
how to calculate the regression line in R
Use the lm function to calculate the value (you can use the summary function to display it)
Add method = lm to the line creating the code for a scatterplot
the data should show the slope, intercept, R-squared, standard error, p-value and test statistic
difference between interpolation and extrapolation
Interpolation: involves making a prediction for a value that sits within the range of our data
More reliable, more accurate
Extrapolation: involve make a prediction for a variable that is outside the range of the data
Not always reliable and can lead to false predictions
Answers are not always logical
what is the coefficient of determination
r2 = the coefficient of determination
the proportion of the variance in y that can be explained by the change in x
when calculating using R can be seen as the average between multiple and adjusted R-squared value
ranges of coefficients values interpretation
if the r2 = 98.6% (98.6% of the change in y is due to x
0- 0.19 = very weak correlation
0.2-0.39 = weak
0.4-0.59 = moderate
0.6 - 0.79 = strong
0.8 - 1 = very strong
what are the parmeters and statistics in regression
the true population value and represented by beta 1 and beta 0 while the sample statistics are b1 and b0 that we can use to predict the population values
how to calculate the confidence intervals in regression
done for both b1 and b0 using the t critical value x the standard error of the respective value
t* is found using a df of n-2
SE can be calculated using R
what ae the hypothesis for regression
the aim of regression is to test whether the slope is zero, showing that a change in one variable does not lead to a change in another
Null: beta 1 = 0
alternative: beta 1 doesnāt = 0
how to calculate the test statistic in rgression
Is the estimated slope divided by the standard error of the estimated slope
If the test stat has t-distribution with in n-2 degrees of freedom then the null hypothesis is true
how is p-value calculated in regression
gained using a t-ditribution with a df of n-2
can be found in the summary stats of the line
what are the assumption in regression
Done using the fitted values and residuals of the data
normality
constant variance
independence
linearity
what is a fitted value
A value found along the fitted line that represents the predicted value for a particular response value
denoted as the y with a hat
will have the same x as the response value we are trying to predict
xi is then any given x varaible along the regression line
what is a residual
ri or the difference between a fitted value (yi with a hat) and an observed value in the gathered data (yi)
difference between what a value should be and what it is
how can the assumption of linearity be checked
Can be assessed by looking at a scatter plot of residuals and fitted values
the assumptions are reasonable when points are randomly scattered above and below the zero line with no distinct pattern
if dots are not close to the line can be assumed to be outliers
how can the assumption of constant spread be checked
can be assessed by looking at the distribution of the scatter plot of residuals versus fitted values on a horizontal plane
should be uniformly spread from left to right
can be clustered in the middle as well as there may just not be extreme high a low values in the data
how can the assumption of normality be checked
can be checked using a q-q plot of residuals in the same way as usual
canāt use central limit theorem to assume
how can the assumption of independence be checked
Can be assessed by looking at the experimental design or by using certain patterns
show that they appear randomly scattered above and below the zero line with no patterns
means that there isnāt a correlation between each data point's residuals
means that knowing the residual for one observation tells you nothing about another observation
how can prediction be made using regression
Predict the response variable for an individual with a given predictor variable using predictor intervals
Predict the mean of the response variable for a population with a particular predictor variable using confidence intervals
how to calculate prediction intervals
Y0(with the hat) ± t* x the standard error of y0 with the hat
provides an upper and lower number that will contain the true response variable
less accurate compared to the confidence interval
calculated using t with df of n-2
how to calculate confidence intervals
the population mean y0/x0 ± t* x standrad error of the population mean
we use b0 + b1 x x 0 to find the mean( we do not know the true parameter so we use our samples estimates)
will be more accurate and have a smaller range compared to prediction intervals
How to interpret prediction
PI: 95% confident that one individual with a <predictor> of <x> will has a <responce varaible> between < lower> and <upper>
CI: 95% confident that the mean <response> of a population with a predictor level of <x0> will be between <lower> and <upper>
how to determine if a response variable is normal using intervals
the the given responce variable falls outside the interval, then it can be considered abnormal
what are all the y varibles in regrression
Yi = an observed value
Yi (with hat) = value with the same x as observed but along the fitted line (fitted value)
Y0 = a predicted value from the data
Y0 (with a hat) = the point on the line where the x is the same as Y0 ( predictor interval)