2024-03-18

Unveiling the Future

Imagine possessing a crystal ball that reveals the future impact of your actions today. How much would you change what you’re doing right now if you knew exactly how much one thing influences another? Welcome to the world of Simple Linear Regression (SLR)—not magic, but close to it.

SLR is our statistical crystal ball, offering the power to predict the future by understanding relationships between variables. It’s like knowing that every extra hour you study could improve your exam score by a certain number of points, or predicting the increase in sales with every hundred dollars spent on marketing.

With SLR, we unveil the mystery of ‘how much of what causes what.’ It simplifies the complex web of data into a clear, linear relationship, allowing us to make informed decisions, forecast outcomes, and strategically plan our next moves. Dive into the journey of SLR with us, and unlock the potential to predict and shape your world with the precision of data.

## `geom_smooth()` using formula = 'y ~ x'

What the Graph?

Curious about the insights hidden in the first slide’s graph? Let’s dive in to uncover its story:

Emotional Intelligence and Team Performance: Ever wondered how emotional intelligence impacts team performance? In an exploratory study published in the Engineering Project Organizational Journal (Vol. 3, 2013), researchers delved into this intriguing connection.

  • Undergraduate students, enrolled in the course Introduction to the Building Industry, were the subjects of this study. Each student completed an emotional intelligence test, yielding intrapersonal, stress management, and mood scores. Organized into 23 teams, students collaborated on group projects, with individual project scores averaged to determine the team’s performance (mean project score is y). The study focused on three independent variables per team:
  1. range of intrapersonal scores (x1)
  2. range of stress management scores (x2)
  3. range of mood scores (x3).

Our mission? To identify the best predictor among these three independent variables.

What the Process?

Now that we’ve explored the underlying relationship between emotional intelligence and team performance, let’s delve deeper into the process of Simple Linear Regression (SLR).

Understanding SLR Coefficients and Formula In SLR, we aim to model the linear relationship between an independent variable (x) and a dependent variable (y) using a straight line equation. The formula for SLR, also known as the first-order model, is represented as: \[ y = \beta_0 + \beta_1 \cdot x + \varepsilon \]

Here:

  • y is the dependent variable (response)
  • x is the independent variable (predictor)
  • β0 is the y-intercept (constant term),
  • β1 is the slope coefficient (change in y for a unit change in x), and
  • ε represents the error term (residuals).

So Where Does that Land Us?

Now that we’ve explored the components of the Simple Linear Regression formula, it’s time to determine our equation. We’ll visualize all the necessary variables to find the best fit for our prediction model.

plot_ly(data, x = ~IntraPers, y = ~StressMan, z = ~Mood, type = "scatter3d", mode = "markers")

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

Determining the Best Predictor

Now, let’s visualize the relationships between each independent variable (Stress Management, Intrapersonal, and Mood) and the dependent variable (Project Scores) to determine the best predictor for our model.
## `geom_smooth()` using formula = 'y ~ x'

## `geom_smooth()` using formula = 'y ~ x'

## `geom_smooth()` using formula = 'y ~ x'

Predicting Project Scores

# Perform Simple Linear Regression
lm_model <- lm(Project ~ StressMan, data = data)  # Assuming Stress Management is the predictor variable

# View Regression Results
summary(lm_model)
## 
## Call:
## lm(formula = Project ~ StressMan, data = data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.9475 -2.5962 -0.1625  2.6349  6.8943 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 84.21943    2.17094  38.794   <2e-16 ***
## StressMan    0.12026    0.08054   1.493     0.15    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.197 on 21 degrees of freedom
## Multiple R-squared:  0.09597,    Adjusted R-squared:  0.05293 
## F-statistic: 2.229 on 1 and 21 DF,  p-value: 0.1503
# Predict Project Scores
new_data <- data.frame(StressMan = c(5, 6, 7))  # Assuming new observations for Stress Management
predicted_scores <- predict(lm_model, newdata = new_data)

# View Predictions
predicted_scores
##        1        2        3 
## 84.82073 84.94099 85.06125

Assessing Significance and Final Formula

After performing the simple linear regression analysis, it’s crucial to assess the significance of the predictors in predicting project scores.

  • The coefficient for Stress Management is not statistically significant, with a p-value of 0.15.
  • Further analysis may be needed to identify other significant predictors.

Importance of Graphs

The best graph is where the plots are closest to the line of best fit. This indicates a stronger linear relationship between the variables.

Performing Simple Linear Regression in R

In R, we can perform the simple linear regression procedure through the following outline process: 1. Load the necessary libraries. 2. Prepare the data. 3. Use the lm() function to fit the regression model. 4. Interpret the results.

Based on all our observations, we can confidently say that the Stress Management variable may not be a significant predictor of project scores.

Final Formula

Based on the regression results, the final formula for predicting project scores is:

\[ \text{Project} = 84.22 + 0.12 \times \text{StressMan} \]

In conclusion, R empowers us to perform magical feats of prediction with remarkable ease. While our initial exploration suggests that Stress Management may not be a significant predictor of project scores, R equips us with the tools to delve deeper into the data and uncover the true drivers of success. With its intuitive syntax and powerful statistical functions, R opens doors to endless possibilities in data analysis and prediction. Let’s continue our journey with R, unraveling the mysteries hidden within our data and making informed decisions with confidence.