🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

Notes for the exam in statistics 1b Covariance (sxy) measures the direction of two variables. A positive value means that if one variable is above its mean, the other variable is also above its mean. A negative value means that if one value is above its mean, the other va...

Notes for the exam in statistics 1b Covariance (sxy) measures the direction of two variables. A positive value means that if one variable is above its mean, the other variable is also above its mean. A negative value means that if one value is above its mean, the other variables are below its mean. Calculate covariance: The correlation coef cient (rxy) measures both the direction and strength of the linear relationship. Calculate correlation: rxy = sxy / sx * sy sx and sy are the standard deviations of x and y which are calculated as: -1 < rxy < 1 Testing population correlation coef cient pxy: Two-tailed test H0: pxy = 0 and HA: pxy ≠ 0 Right tailed test H0: pxy ≤ 0 and HA: pxy > 0 Left tailed test H0: pxy ≥ 0 and HA: pxy < 0 Test statistics for pxy: tdf = rxy / sr Where df = n-2 and sr = ⎷(1-(rxy)2 (n-2) fi fi The residual (e) refers to the difference between the observed and the predicted values of y, that is: y-ŷ Ordinary least squares (OLS) is a method that chooses the line whereby the error sum of squares (SSE) is minimised. SEE = ∑ (yi-ŷi)2 = ∑ei2 Calculating b1 and b0 b1 = ∑ (xi-x̄ ) (yi-ȳ) / ∑(xi-x̄ )2 b0 = ȳ-b1*x̄ Goodness-of- t measures The standard error of estimate: The sample variance (se2) measures the average squared difference between y and predicted y. se2 = SSE / n-k-1 The standard error of estimate (se) is the square root of the sample variance and shows the residual's standard deviation. 0 < se < ∞. The closer se is to zero, the better the model ts the sample data. fi fi For a given sample size n, increasing the number k of the explanatory variables reduces both the numerator (SSE) and the denominator (n - k - 1) in the formula for sc. The net effect, shown by the value of sc, allows us to determine if the added explanatory variables improve the t of the model. R2: quanti es the sample variation in the response variable that is explained by the sample regression equation. It is computed as the ratio of the explained variation of the response vari ble to its total variation. For example, if R2 = 0.72, we say that 72% of the sample variation in the response variable is explained by the sample regression equation. The total variation (SST) = ∑(yi-ȳ)2 SSR = ∑(ŷi-ȳ)2 SSR is a measure of the explained variation in y. SSE is a measure of the unexplained variation in y. SST = SSR + SSE R2 = SSR / SST = 1 - SSE / SST The value of R2 falls between zero and one, 0 < R2 < 1. The closer R2 is to one, the stronger the t; the closer it is to zero, the weaker the t. fi fi a­ fi fi Adjusted R2: Adjusted R2 accounts for the number of explanatory variables k. It is common to use adjusted R2 for model selection because it imposes a penalty for any additional explanatory variable that is included in the analysis. Adjusted R2 = 1-(1-R2)(n-1/n-k-1) Adjusted R2 is used to compare competing linear regression models with different numbers of explanatory variables; the higher the adjusted R2, the better the model. Test statistic for individual signi cance tdf = bj - bj0 / se (bj) Where df = n-k-1 Con dence interval for βj βj ± ta/2,df se(βj) Test statistic for joint signi cance H0: β1 = β2 … = 0 Ha: At least one βj ≠ 0 fi fi fi F(df1,df2) = SSR/k / SSE/(n-k-1) = MSR/MSE Where df1 = k, df2 = n-k-1 In general, a large value of F(df1,df2) indicates that a large portion of the sample variation in y is explained by the regression model; thus, the model is useful. Vi jämför det observerade F-värdet (96,85 från outputen) med det kritiska F-värdet för en given signi kansnivå (α), vanligtvis α = 0,05. Alternativt använder vi p-värdet för F- testet (6,75197E-78). Om p-värdet är mindre än signi kansnivån (α), förkastar vi nollhypotesen. Reject or not reject null hypothesis P < α reject null hypothesis P > α do not reject null hypothesis Multicollinearity: Perfect multicollinearity exists when two or more explanatory variables have an exact linear relationship. If multicollinearity is severe, we may nd insigni cance of important explanatory variables; some coef cient estimates may even have the wrong sign. The detection methods for multicollinearity are mostly informal. The presence of a high R2 coupled with individually insigni cant explanatory variables can indicate multicollinearity. Homocedasticity: refers to a situation in regression analysis where the variance of the errors (residuals) is constant across all levels of the independent variables. fi fi fi fi fi fi The quadratic regression model In a quadratic regression model y = β0 + β1x + β2x2 + ℇ, the coef cient β2 dete mines whether the relationship between x and y is U-shaped (β2 > 0) or inverted U-shaped (β2< 0). Predictions with a quadratic model are made by y = β0 + β1x + β2x2 + ℇ. Evaluating the marginal effect of x on y in the quadratic regression model: It is important to evaluate the estimated marginal (partial) effect of the explanatory variable x on the predicted value of the response variable; that is, we want to evaluate the change in y due to a one unit increase in x. In a quadratic regression model, it can be shown with calculus that the marginal effect of x on y can be approximated by y = β0 + β1x + 2β2x + ℇ. β2: Change in the slope of y with respect to x, affecting the rate of change as x increases. How to interpret: (β0 = 30): Inkomsten är 30 tusen kronor för 0 år av utbildning. (β1 =12): För varje ytterligare år av utbildning ökar inkomsten med 12 tusen kronor. (β2 =−0.8): Effekten av utbildning på inkomsten minskar efter en viss punkt. (β3 =0.05): Denna koef cient indikerar att det nns en svag ökning av inkomstens tillväxttakt vid högre utbildningsnivåer. Det innebär att efter en viss utbildningsnivå kan effekten av ytterligare år av utbildning börja öka igen, vilket kan leda till en mer komplex kurva med era vändpunkter. fl fi fi fi r­ Regression models with logarithms: Log-log model: ln(y) = = β0 + β1ln(x) + ℇ Log Y and X1 interpretation: Changing the variable X1 by 1 % will change Y by approximately β1 % Predictions with a log-log model are made by ŷ = exp(β0 + β1 ln(x) + se2/2) Semi-log or logarithmic model: y = β0 + β1ln(x) + ℇ Log X1 interpretation: Changing the variable X1 by 1 % will change Y by approximately β1 / 100 units Predictions with a logarithmic model are made by ŷ = β0 + β1ln(x) Exponential model: Log Y interpretation: Changing the variable X1 by unit will change Y by approximately β1 * 100 % Predictions with a log-log model are made by ŷ = exp(β0 + β1 ln(x) + se2/2) Regression with dummy variables A dummy variable affects the intercept but not the slope. The difference between the intercepts is β2 when d changes from 0 to 1. d = 0 → ŷ = (β0 + β2) + β1x d = 1 → ŷ = β0 + β1x Binary choice models: Regression models that use a dummy (binary) variable as the response variable are called binary choice models. They are also referred to as discrete choice models or qualitative response models. Linear regression model (LPM) - a model where the response variable is binary. β1= 0.0188 implies that a 1-percentage-point increase in down payment increases the approval probability by 0.0188, or by 1.88% The logit model: One shortcoming of the LPM model is that for any given slope, we can nd some value of x for which the predicted pro ability is outside the [0,1] interval. We basically want a nonlinear speci cation that constrains the predicted probability between 0 and 1. P = exp(β0 + β1x) / 1 + exp (β0 + β1x) The logit model cannot be estimated with standard ordinary least squares (OLS) procedures. Instead, we rely on the method of maximum likelihood estimation (MLE) to estimate a logit model. For instance, if the estimated LPM is P = -0.20 + 0.03x, it implies that for every 1-unit increase in x, the predicted probability P increases by 0.03. Låg determinationskoef cient men högt (signi kant) F-värde En regressionsanalys kan ge en låg determinationskoef cient (R2) men samtidigt ett högt och signi kant F-värde. Detta tyder inte nödvändigtvis på ett problem i modellen, utan det kan bero på hur man tolkar R2 och F-värdet. fi fi fi b­ fi fi fi F-värde: F-värdet testar den övergripande modellen och indikerar om minst en av de oberoende variablerna är signi kant relaterad till den beroende variabeln. Ett högt och signi kant F-värde betyder att modellen som helhet har en statistiskt signi kant förklaringskraft. Låg determinationskoef cient: En låg R2 betyder att modellen förklarar en relativt liten andel av variationen i den beroende variabeln. Detta kan hända i vissa verkliga situationer, exempelvis när inkomst eller någon annan beroende variabel påverkas av många faktorer som inte ingår i modellen. Varför är detta inte nödvändigtvis ett problem? En låg determinationskoef cient i kombination med ett signi kant F-värde kan uppstå i situationer där de oberoende variablerna har en signi kant men begränsad förklaringskraft. Modellen kan alltså vara signi kant men ändå inte förklara en stor del av variationen. Så länge modellen är korrekt speci cerad och relevanta variabler nns med, är detta inte ett problem. Det visar bara att det nns andra faktorer utanför modellen som påverkar den beroende variabeln. Hög determinationskoef cient men insigni kanta oberoende variabler (låga t-värden) En hög determinationskoef cient (R2) men insigni kanta oberoende variabler (låga t- värden) kan vara ett problem och tyder ofta på att det nns multikollinearitet eller andra modellproblem. Hög R2: Detta indikerar att modellen förklarar en stor del av variationen i den beroende variabeln. Insigni kanta oberoende variabler: Låga t-värden och höga p-värden för de enskilda oberoende variablerna innebär att de inte är statistiskt signi kanta, vilket betyder att vi inte kan säga med säkerhet att dessa variabler har en verklig effekt på den beroende variabeln. fi fi fi fi fi fi fi fi fi fi fi fi fi fi fi fi fi fi Varför är detta ett problem? Detta resultat kan ofta indikera multikollinearitet, vilket innebär att de oberoende variablerna är högt korrelerade med varandra. När variabler är multikollineära, kan det vara svårt för modellen att skilja deras individuella effekter på den beroende variabeln, vilket leder till högt R2 (där modellen som helhet förklarar mycket) men insigni kanta individuella variabler (låga t-värden). Multikollinearitet: Multikollinearitet gör att estimaten av koef cienterna blir instabila och kan få höga standardfel, vilket i sin tur leder till låga t-värden och höga p-värden. Detta kan maskera den verkliga effekten av de oberoende variablerna. Lösning: Om multikollinearitet misstänks, kan man testa detta genom att använda Variance In ation Factor (VIF) eller genom att ta bort vissa variabler som är starkt korrelerade. Det kan också hända om du har en överspeci cerad modell, där du har inkluderat variabler som R2 vara hög för att modellen som helhet är "överanpassad" till data, men de individuella variablerna har inte någon statistiskt signi kant effekt. Practice interpretation: fl fi fi fi fi Extrapolering Interpolering

Use Quizgecko on...
Browser
Browser