You are on page 1of 4

1

-NAME: Peetha Soma Tejaswi


REG.NO: -21BCB7133

Q1. Do the Regression analysis and find the regression line


for the following given data sets:
a) Data on number of hours studied per week and the corresponding
GPA for students in a certain class:

Sol: CODE:
attach(Book1)
hours
GPA
cor(hours,GPA)
regression<-lm(GPA~hours)
summary(regression)
plot(GPA,hours)
abline(lm(hours~GPA))
2

OUTPUT:
3

b) Data about age and resting heart rate for 15 individuals

Sol: CODE:

attach(book_2)
age
`resting heart rate`
cor(age,`resting heart rate`)
regression<-lm (`resting heart rate`~age)
summary(regression)
plot (`resting heart rate`,age)
abline(lm(age~`resting heart rate`))
4

OUTPUT:

You might also like