

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Name: Bhavya Gupta Roll No: 101903215 Group: 2CO
Ques 1:
getwd() setwd("E:\SEM-5 Thapar\Probability_Statistics") df <- read.csv("turnout.csv",sep=",",header=TRUE)
df1 <- sample(nrow(df),nrow(df)*0.7) #70% training data train <- df[df1,] test <- df[-df1,]
actual <- test[,5] #dependent variable column of test data predicted <- lm(income ~ age + education, data=train) p <- predict(predicted,test)
rmse <- function(actual,predicted) { a<-(actual-predicted)** m<-mean(a) sqrt(m) }
rmse(p,actual) plot(predicted)
Ques 2:
x <- runif(1000, min=10, max=33)