Professional Documents
Culture Documents
Name: Badigi Shivakumar Reg - No: 20MIS0173 Lab - Slot: L9+L10 Date: 02-09-2021
Name: Badigi Shivakumar Reg - No: 20MIS0173 Lab - Slot: L9+L10 Date: 02-09-2021
No : 20MIS0173
LAB ASSIGNMENT - 2
Problem 1: You can choose your data: Collect the data for 50 pair of
observations say . Here, the pair of observations can be represent heights and
weights of a 50 persons, or heights of father and sons, or price and sales of a
product per 50 days, marks of 50 students in two different subjects and so on .
Write the R code to obtain the coefficient of linear relationship between the
above said pair of observations and comment on the result.
Coefficients:
(Intercept) y
122.1963 -0.4917
> lm(y~x)
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
105.5366 -0.3194
> # linear regression lines between mental ability (x) and human
resources (y) are y= -0.3194x+105.5366 (or) x= -0.4917y+122.1963
>
> cor(x,y)
[1] -0.39629
> cor(x,y,method="pearson")
[1] -0.39629
> # HENCE, CORRELATION IS WEAK INTO THE NEGITIVE DIRECTION .,
>
> plot(x,y,main= ' PERCENTAGES OF MARKS IN MENTAL ABILITY vs
PERSENTAGES OF MARKS IN HUMAN RESOURCES')
> lines(x,y,col="black",type="o")
Problem 3: Suppose we have ranks of 10 days sales of a product in three
localities. Find which two localities have the same trend of sales.
Jaipur: 4 6 2 3 5 8 10 9 1 7
Vellore: 3 10 4 5 6 7 2 8 19
Nagpur: 5 1 3 10 4 8 7 9 2 6