R Markdown
my_data1 <- data.frame(
Y = c(2.84, 3.2, 3.4, 2.9, 3.4, 3.45, 2.5, 3.1, 3.25, 2.7, 3.45, 3.9, 3.80, 3.12, 2.99, 3.00, 3.2, 3.44, 1.90, 2.3, 3.70, 3.95, 3.5, 3.8, 3.23),
age = c(20, 21, 23, 24, 22, 20, 21, 20, 21, 24, 19, 20, 18, 22, 21, 23, 22, 21, 20, 20, 24, 21, 23, 22, 20),
marks = c(720, 500, 620, 800, 750, 720, 850, 900, 560, 444, 873, 345, 750, 650, 555, 666, 888, 579, 590, 690, 450, 889, 450, 720, 1000),
income = c(11000, 20000, 23000, 22000, 35000, 23000, 20000, 15000, 21000, 10000, 9000, 25000, 40000, 50000, 28000, 25000, 38000, 34000, 23000, 45000, 21000, 28000, 34000, 34000, 56000),
CGPA = c(3.78, 3.75, 3.77, 3.80, 3.90, 3.01, 3.02, 3.20, 3.10, 3.9, 3.8, 3.11, 3.40, 3.13, 3.15, 3.89, 3.77, 3.66, 2.80, 3.15, 3.44, 2.90,3.8,3.5,3.60))
my_data1
## Y age marks income CGPA
## 1 2.84 20 720 11000 3.78
## 2 3.20 21 500 20000 3.75
## 3 3.40 23 620 23000 3.77
## 4 2.90 24 800 22000 3.80
## 5 3.40 22 750 35000 3.90
## 6 3.45 20 720 23000 3.01
## 7 2.50 21 850 20000 3.02
## 8 3.10 20 900 15000 3.20
## 9 3.25 21 560 21000 3.10
## 10 2.70 24 444 10000 3.90
## 11 3.45 19 873 9000 3.80
## 12 3.90 20 345 25000 3.11
## 13 3.80 18 750 40000 3.40
## 14 3.12 22 650 50000 3.13
## 15 2.99 21 555 28000 3.15
## 16 3.00 23 666 25000 3.89
## 17 3.20 22 888 38000 3.77
## 18 3.44 21 579 34000 3.66
## 19 1.90 20 590 23000 2.80
## 20 2.30 20 690 45000 3.15
## 21 3.70 24 450 21000 3.44
## 22 3.95 21 889 28000 2.90
## 23 3.50 23 450 34000 3.80
## 24 3.80 22 720 34000 3.50
## 25 3.23 20 1000 56000 3.60
# Performing multiple regression
model <- lm(Y ~ age + marks + income + CGPA, data = my_data1)
# Displaying the summary of the regression model
summary(model)
##
## Call:
## lm(formula = Y ~ age + marks + income + CGPA, data = my_data1)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.16211 -0.21905 0.07508 0.24490 0.96723
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.080e+00 1.783e+00 1.727 0.0996 .
## age -3.868e-02 8.077e-02 -0.479 0.6372
## marks -3.390e-04 6.977e-04 -0.486 0.6323
## income 6.356e-06 9.284e-06 0.685 0.5014
## CGPA 2.892e-01 3.383e-01 0.855 0.4027
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5298 on 20 degrees of freedom
## Multiple R-squared: 0.05465, Adjusted R-squared: -0.1344
## F-statistic: 0.2891 on 4 and 20 DF, p-value: 0.8816