This video demonstrates how to perform simple linear regression in R using the lm() function, where the model salary = β₀ + β₁ × experience + error is tested by examining coefficient estimates, t-values, p-values, R², and F-statistic to determine if a significant linear relationship exists between years of experience and salary.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Performing Regression in R. #econometrics #regression #RAdded:
So far we have learned many important things which are essential to interpret the result of regression analysis and now we will run the regression on our software and try to examine it. We will be using data on number of years of experience and salary and try to check if there exist a relationship between these variables. Here the number of experience is X variable and salary is Y variable. Our model will look like salary is equal to beta zero plus beta one into experience plus error term. We will have our null hypothesis as the number of years of experience does not have a simple linear relationship with salary. On our software we will first call library read excel and then create an object named data using read excel function and call our data.
Then we will use STR function to see the structure of data as visible on the screen. Here we can see that the first column is for years of experience and second is for the salary.
Then we will name columns as X and Y and check the structure again. After that we will create an object named model and regress our data using the linear model LM function as shown on the screen.
After this to get a summary of regression we will run summary model which will give us summary of residuals, coefficient estimates, standard error, T value, R squared, adjusted R squared and F statistic. Here we can see that the intercept or beta zero hat estimate is 24,848.2.
The slope or beta one hat estimate is 9,450.
The high T value and very low P value for both estimates are significant to reject the null hypothesis and we can say that there exist a linear relationship between numbers of years of experience and salary. We can see that both R squared and adjusted R squared are above 0.95, which means they fit the model very well. The high F statistic along with low P value indicates that the simple linear regression model is statistically significant overall. Meaning the independent variable explains a significant portion of the variation in the dependent variable. The overall F statistic and the T test for the slope coefficient are effectively testing the same thing because it is simple linear regression. We can use this regression model in R for further examination using the object named model. Follow for upcoming videos.
Related Videos
Truckers Finally Seeing Higher Rates… But Carriers Are STILL Going Bankrupt
LetsTruckTribe
480 views•2026-05-28
IS THIS THE REAL REASON FOR DATA CENTERS?
PrepperDawg
7K views•2026-05-31
JPMorgan CEO JUST NUKED Mamdani... as NYC's Middle Class COLLAPSES
Englishman-In-NewYork
7K views•2026-05-30
The Dark Age Of Blue Collar Has Begun
derekpolasekofficial
4K views•2026-05-28
Why People Pay More For Someone They Trust
financian_
66K views•2026-05-28
What has a broader economic impact, corporate downsizing or ecological collapse?
theratracejournal
1K views•2026-05-29
China Is Quietly Buying Gold, the Iran Deal Is Frozen, and Silver Is Heating Up
RichardHolloway0
694 views•2026-05-31
Why Canadians can no longer afford to survive #canada #inflation #shorts
TrueNorthInvestor-v4j
131 views•2026-06-01











