Uploaded by Saira Arshad

BIOSTAT ASSINMENT #02

advertisement
Correlation
Two or more than two variables relation is called correlation. If we have two quantitative
variables, we apply correlation coefficient. Correlation coefficient tells about
>Direction of relation: Either positive or negative
> Strength of relation: weak, strong, mediate or perfect
> age=c(32,36,39,40,42,45,46,47,49,52)
> weight=c(70,72,75,78,82,83,85,88,90,93)
> length(age)
[1] 10
> length(weight)
[1] 10
> plot(age,weigh,main = "scattor plot of stds",xlab = "age of stds"
+
,ylab = "weight of stds",xlim = c(30,55),ylim = c(70,95
> cor(age,weight)
[1] 0.9868115
Interpretation
This scatter plot shows the strong positive correlation between two variables (age and weight),
that is 0.9868115
Regression Analysis
It describes the dependency of different variables between each other
Simple Linear Regression Equation
Y=a + bx
It is the mathematical expression of regression in which:




Y is dependent variable
a is intercept
b is regression coefficient
x is independent variable
Regression Coefficient
For a 1 unit change in independent variable how much change occur in dependent variable is
explained by regression coefficient
Coefficient of determination
Total variation in dependent variable due to independent variable is explained by coefficient of
determination
Example
>
>
>
>
>
>
#regression analysis
#y=blood pressure,x1=age
y=c(90,95,101,105,109,115,115,120,117,124)
x1=c(35,37,39,42,42,45,42,48,49,50)
regression=lm(y~x1)
regression
Call:
lm(formula = y ~ x1)
Coefficients:
(Intercept)
19.561
x1
2.087
Interpretation
For 1 year increase in age, blood pressure increased by 2.087.
Download