soru 1

Determinants of [Kole] MPO] GPAI.Variables included in RAW, for a sample of 141 students from a large university, the college graduation grade average (colGPA), high school MPO (hsGPA) and bagan test grade (ACT) iger- tion. Both college and high school mPOS are on a 4-point scale. SEKK regression in the tree we can obtain the accuracy from the high school MPO and baçan test grade to predict the college MPO:

colGPA = 1.29 + 0.453 hsGPA + 0.0094 ACT

colGPA = 1,29 + 0,453 hsGPA + 0,0094 ACT

library(wooldridge)
data(gpa1)
library(rmarkdown)
paged_table(gpa1)
coklureg <- lm(colGPA~ hsGPA+ACT,data = gpa1)
summary(coklureg)
## 
## Call:
## lm(formula = colGPA ~ hsGPA + ACT, data = gpa1)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.85442 -0.24666 -0.02614  0.28127  0.85357 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 1.286328   0.340822   3.774 0.000238 ***
## hsGPA       0.453456   0.095813   4.733 5.42e-06 ***
## ACT         0.009426   0.010777   0.875 0.383297    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3403 on 138 degrees of freedom
## Multiple R-squared:  0.1764, Adjusted R-squared:  0.1645 
## F-statistic: 14.78 on 2 and 138 DF,  p-value: 1.526e-06

Answer colGPA = 1,29 + 0,453 hsGPA + 0,0094 ACT

if n = 141, R2 = 0,176

simple regresyon

basitreg <- lm(colGPA~ACT,data = gpa1)
summary(basitreg)
## 
## Call:
## lm(formula = colGPA ~ ACT, data = gpa1)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.85251 -0.25251 -0.04426  0.26400  0.89336 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.40298    0.26420   9.095  8.8e-16 ***
## ACT          0.02706    0.01086   2.491   0.0139 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3656 on 139 degrees of freedom
## Multiple R-squared:  0.04275,    Adjusted R-squared:  0.03586 
## F-statistic: 6.207 on 1 and 139 DF,  p-value: 0.0139

## The coefficient of ACT remains quite large compared to multiple regression (0.02706/0.009426=2.87 times more)

finally, let’s show simple regression graphs with two independent variables. For our simple regression example, let’s remember that it is enough for us to add a regression line to the scatter plot

plot(gpa1$ACT,gpa1$colGPA)
abline(basitreg)

Omitted Variable Bias

Since education will increase because talent increases, not adding talent to the model

it leads to the fact that his estimate increases so much.

Now let’s show this calculation through an example. If we recall this example

library(stargazer)
## 
## Please cite as:
##  Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables.
##  R package version 5.2.3. https://CRAN.R-project.org/package=stargazer
stargazer(list(coklureg,basitreg),type = "text")
## 
## =================================================================
##                                  Dependent variable:             
##                     ---------------------------------------------
##                                        colGPA                    
##                               (1)                    (2)         
## -----------------------------------------------------------------
## hsGPA                      0.453***                              
##                             (0.096)                              
##                                                                  
## ACT                          0.009                 0.027**       
##                             (0.011)                (0.011)       
##                                                                  
## Constant                   1.286***               2.403***       
##                             (0.341)                (0.264)       
##                                                                  
## -----------------------------------------------------------------
## Observations                  141                    141         
## R2                           0.176                  0.043        
## Adjusted R2                  0.164                  0.036        
## Residual Std. Error    0.340 (df = 138)       0.366 (df = 139)   
## F Statistic         14.781*** (df = 2; 138) 6.207** (df = 1; 139)
## =================================================================
## Note:                                 *p<0.1; **p<0.05; ***p<0.01

it can also be found from the simple regression Decoupling of two independent variables between each other

sapmareg<-lm(hsGPA~ACT,data = gpa1)
stargazer(list(sapmareg),type = "text")
## 
## ===============================================
##                         Dependent variable:    
##                     ---------------------------
##                                hsGPA           
## -----------------------------------------------
## ACT                          0.039***          
##                               (0.009)          
##                                                
## Constant                     2.463***          
##                               (0.218)          
##                                                
## -----------------------------------------------
## Observations                    141            
## R2                             0.120           
## Adjusted R2                    0.113           
## Residual Std. Error      0.301 (df = 139)      
## F Statistic           18.879*** (df = 1; 139)  
## ===============================================
## Note:               *p<0.1; **p<0.05; ***p<0.01

Homoskedastisite (Eş varyanslık), (Multicollinearity) ve (Variance inflation factor (VIF)

standarthata<-summary(coklureg)$sigma
standarthata
## [1] 0.3403158

To calculate the standard error, we use only the sigma command. We calculated the standard error as 0.34 for the colGPA sample. that is, the square of the standard error will give us the variance of the margin of error of our regression.

sigmakare<-standarthata^2
sigmakare
## [1] 0.1158148
Rjkare<-summary(sapmareg)$r.squared
Rjkare
## [1] 0.1195815

variance inflation factor

VIF<-1/(1-Rjkare)
VIF
## [1] 1.135823

finally, we need to find N.

n<-nobs(coklureg)
n
## [1] 141

finally, click Var need to find out

varxj<-var(gpa1$hsGPA)*(n-1)/n
varxj
## [1] 0.1016267

Now using our formula Var we can calculate the.

varbetaj<-(1/n)*(sigmakare/varxj)*VIF
varbetaj
## [1] 0.009180115

Bj’s standard mistake is Bj is the karakök of Bj’

sdbetaj<-varbetaj^0.5
sdbetaj
## [1] 0.09581292

An easy way to find VIF was to install the car package

require(car)
## Loading required package: car
## Loading required package: carData
vif(coklureg)
##    hsGPA      ACT 
## 1.135823 1.135823
library(plotly)
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(reshape2)
cf.mod <- coef(coklureg)
hsGPA <- seq(min(gpa1$hsGPA),max(gpa1$hsGPA),length.out=50)
ACT <- seq(min(gpa1$ACT),max(gpa1$ACT),length.out=50)
colGPA <- t(outer(hsGPA, ACT, function(x,y) cf.mod[1]+cf.mod[2]*x+cf.mod[3]*y))
p <- plot_ly(x=~hsGPA, y=~ACT, z=~colGPA,type="surface") %>%
  add_trace(data=gpa1, x=gpa1$hsGPA, y=gpa1$ACT, z=gpa1$colGPA, mode="markers", type="scatter3d", opacity=0.5)
p