- Bağlantıyı al
- X
- E-posta
- Diğer Uygulamalar
- Bağlantıyı al
- X
- E-posta
- Diğer Uygulamalar
The correlation and regression:
Firstly, we created random number with the sample() function. The 10 different numbers are selected from 1 to 100.
We created the data.frame with our 3 variables' datasets.
Now, we calculate the correlation among the variables
It is time to see relationship between two different variables
a is dependent and c is independent variable.
and other complimentaries
Source:R Programming and Its Applications in Financial Mathematics
Firstly, we created random number with the sample() function. The 10 different numbers are selected from 1 to 100.
a=sample(1:100, 10)
b=sample(1:100, 10)
c=sample(1:100, 10)
We created the data.frame with our 3 variables' datasets.
price = data.frame(a,b,c)
Now, we calculate the correlation among the variables
cor(price$a,price$b)
-0.1215828
cor(price$a,price$c)
0.4716212
cor(price$b,price$c)
0.06092046
It is time to see relationship between two different variables
a is dependent and c is independent variable.
reg=lm(a~c, data = price)
summary(reg)
and other complimentaries
predict(reg)
residuals(reg)
coefficients(reg)
lm(formula = a ~ c + b, data = price)
Source:R Programming and Its Applications in Financial Mathematics
- Bağlantıyı al
- X
- E-posta
- Diğer Uygulamalar
Yorumlar
Yorum Gönder