assigment03 18i-1297 (Waqar Saleem)

advertisement
Waqar Saleem
MS (DS)
18I-1297
WorldBankData <- read.csv("E:/semester 1/staticses and mathematics/WorldBankData.csv")
impordata <- subset(WorldBankData,Country=='Denmark')
import <- subset(impordata,year>=1990)
numerator <- nrow(import)*sum(import$population*import$internet.users) sum(import$population)*sum(import$internet.users)
denumerator <- sqrt(nrow(import)*sum(import$population*import$population )-(sum
(import$population ))*(sum (import$population
)))*sqrt(nrow(import)*sum(import$internet.users*import$internet.users )-(sum (import$internet.users
))*(sum (import$internet.users )))
r <- numerator / denumerator
plot(import$year,import$population)
x <- import$year
y <- import$population
mod <-lm(y~x)
pred <-predict(mod)
line(pred)
Waqar Saleem
mod2 <-lm(y~r(x^2))
pred2 <-predict(mod2)
line(pred2)
mod2 <-lm(y~r(ln(x)))
pred2 <-predict(mod2)
line(pred2)
MS (DS)
18I-1297
Download
Related flashcards
Create Flashcards