0% found this document useful (0 votes)
3 views1 page

7 Regression

The document contains R code for performing simple and multiple regression analyses using Excel data. It reads data from two Excel files: one for simple regression with variables x and y, and another for multiple regression analyzing salary based on performance rating, experience, and certifications. The code includes plotting and summarizing the regression results.

Uploaded by

saksheemehta36
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

7 Regression

The document contains R code for performing simple and multiple regression analyses using Excel data. It reads data from two Excel files: one for simple regression with variables x and y, and another for multiple regression analyzing salary based on performance rating, experience, and certifications. The code includes plotting and summarizing the regression results.

Uploaded by

saksheemehta36
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

#---------------regression

library(readxl)
library(readxl)
SIMPLE_REGRESSION <- read_excel("C:/D drive/NEHA/Colleges/SLC/ALL PPTS/BA/2026/sent
to students/SIMPLE [Link]")
View(SIMPLE_REGRESSION)

xy <- SIMPLE_REGRESSION
View(xy)

attach(xy)
str(xy)

plot(xy$x,xy$y)
abline(lm(xy$y~xy$x))

result=lm(xy$y~xy$x)

result
summary(result)

library(readxl)
Multiple_Regression_Salary_Data <- read_excel("C:/D drive/NEHA/Colleges/SLC/ALL
PPTS/BA/2026/sent to students/Multiple Regression - Salary [Link]")
View(Multiple_Regression_Salary_Data)

salary <- Multiple_Regression_Salary_Data


View(salary)

res=lm(salary$`Salary (Annual)`~salary$`Average Performance Rating`+


salary$`Experience in Years`+
salary$Certifications)
res
summary(res)

You might also like