Welcome to the Simplilearn Community

Want to join the rest of our members? Sign up right away!

Sign Up

Data Science Certification Training - R Programming|Arindam|Feb 15-Mar 3

Suman Basu

Active Member
Alumni
Customer
Hi Team,

Kindly find this forum for your Data Science Certification Training - R Programming discussion.

Thanks and regards,
Simplilearn
 

Brighty

Member
hi i was doing an assignment which Arindham has given,linear regression
I'm getting an error saying Quantpsyc package is not installed,,even I try to install the package I'm not able to do so.
my code:
install.packages()
library(boot)
library(car)
library(Quantpsyc)
library(lmtest)
library(sandwich)
library(vars)
library(nortest)
library(mass)
setwd("D://Brighty")
data<-read.csv("Data.csv")
str(data)
summary(data)
boxplot(data$Price_house)
quantile(data$Price_house, c(0,0.05,0.1,0.25,0.5,0.75,0.90,0.95,0.99,0.995,1))
data2 <- data[data$Price_house <8200, ]
boxplot(data2$Price_house)


this is what I'm getting
/*
library(boot)
> library(car)
> library(Quantpsyc)
Error in library(Quantpsyc) : there is no package called ‘Quantpsyc’
> library(lmtest)
> library(sandwich)
> library(vars)
> library(nortest)
> library(mass)
Error in library(mass) : there is no package called ‘mass’
> setwd("D://Brighty")
> data<-read.csv("Data.csv")
> str(data)
'data.frame': 7071 obs. of 11 variables:
$ Item_Weight : num 9.3 5.92 17.5 19.2 8.93 ...
$ Item_Fat_Content : chr "Low Fat" "Regular" "Low Fat" "Regular" ...
$ Item_Visibility : num 0.016 0.0193 0.0168 0 0 ...
$ Item_Type : chr "Dairy" "Soft Drinks" "Meat" "Fruits and Vegetables" ...
$ Item_MRP : num 249.8 48.3 141.6 182.1 53.9 ...
$ Outlet_Identifier : chr "OUT049" "OUT018" "OUT049" "OUT010" ...
$ Yrs_since_inception : int 17 7 17 18 29 7 29 14 9 17 ...
$ Outlet_Size : chr "Medium" "Medium" "Medium" "Medium" ...
$ Outlet_Location_Type: chr "Tier 1" "Tier 3" "Tier 1" "Tier 3" ...
$ Outlet_Type : chr "Supermarket Type1" "Supermarket Type2" "Supermarket Type1" "Grocery Store" ...
$ sales : num 3735 443 2097 732 995 ...
> summary(data)
Item_Weight Item_Fat_Content Item_Visibility Item_Type Item_MRP Outlet_Identifier
Min. : 4.555 Length:7071 Min. :0.00000 Length:7071 Min. : 31.49 Length:7071
1st Qu.: 8.774 Class :character 1st Qu.:0.02678 Class :character 1st Qu.: 94.14 Class :character
Median :12.600 Mode :character Median :0.05249 Mode :character Median :142.91 Mode :character
Mean :12.858 Mean :0.06397 Mean :141.27
3rd Qu.:16.850 3rd Qu.:0.09278 3rd Qu.:186.01
Max. :21.350 Max. :0.31109 Max. :266.89
NA's :11
Yrs_since_inception Outlet_Size Outlet_Location_Type Outlet_Type sales
Min. : 7.00 Length:7071 Length:7071 Length:7071 Min. : 33.29
1st Qu.: 9.00 Class :character Class :character Class :character 1st Qu.: 920.80
Median :14.00 Mode :character Mode :character Mode :character Median : 1789.67
Mean :15.53 Mean : 2118.39
3rd Qu.:19.00 3rd Qu.: 2966.14
Max. :31.00 Max. :10256.65

> boxplot(data$Price_house)
Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) :
need finite 'ylim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
> quantile(data$Price_house, c(0,0.05,0.1,0.25,0.5,0.75,0.90,0.95,0.99,0.995,1))
0% 5% 10% 25% 50% 75% 90% 95% 99% 99.5% 100%
NA NA NA NA NA NA NA NA NA NA NA
> data2 <- data[data$Price_house <8200, ]
> boxplot(data2$Price_house)
Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) :
need finite 'ylim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
> install.packages()
> library(boot)
> library(car)
> library(Quantpsyc)
Error in library(Quantpsyc) : there is no package called ‘Quantpsyc’
> library(lmtest)
> library(sandwich)
> library(vars)
> library(nortest)
> library(mass)
Error in library(mass) : there is no package called ‘mass’
> setwd("D://Brighty")
> data<-read.csv("Data.csv")
> str(data)
'data.frame': 7071 obs. of 11 variables:
$ Item_Weight : num 9.3 5.92 17.5 19.2 8.93 ...
$ Item_Fat_Content : chr "Low Fat" "Regular" "Low Fat" "Regular" ...
$ Item_Visibility : num 0.016 0.0193 0.0168 0 0 ...
$ Item_Type : chr "Dairy" "Soft Drinks" "Meat" "Fruits and Vegetables" ...
$ Item_MRP : num 249.8 48.3 141.6 182.1 53.9 ...
$ Outlet_Identifier : chr "OUT049" "OUT018" "OUT049" "OUT010" ...
$ Yrs_since_inception : int 17 7 17 18 29 7 29 14 9 17 ...
$ Outlet_Size : chr "Medium" "Medium" "Medium" "Medium" ...
$ Outlet_Location_Type: chr "Tier 1" "Tier 3" "Tier 1" "Tier 3" ...
$ Outlet_Type : chr "Supermarket Type1" "Supermarket Type2" "Supermarket Type1" "Grocery Store" ...
$ sales : num 3735 443 2097 732 995 ...
> summary(data)
Item_Weight Item_Fat_Content Item_Visibility Item_Type Item_MRP Outlet_Identifier
Min. : 4.555 Length:7071 Min. :0.00000 Length:7071 Min. : 31.49 Length:7071
1st Qu.: 8.774 Class :character 1st Qu.:0.02678 Class :character 1st Qu.: 94.14 Class :character
Median :12.600 Mode :character Median :0.05249 Mode :character Median :142.91 Mode :character
Mean :12.858 Mean :0.06397 Mean :141.27
3rd Qu.:16.850 3rd Qu.:0.09278 3rd Qu.:186.01
Max. :21.350 Max. :0.31109 Max. :266.89
NA's :11
Yrs_since_inception Outlet_Size Outlet_Location_Type Outlet_Type sales
Min. : 7.00 Length:7071 Length:7071 Length:7071 Min. : 33.29
1st Qu.: 9.00 Class :character Class :character Class :character 1st Qu.: 920.80
Median :14.00 Mode :character Mode :character Mode :character Median : 1789.67
Mean :15.53 Mean : 2118.39
3rd Qu.:19.00 3rd Qu.: 2966.14
Max. :31.00 Max. :10256.65

> boxplot(data$Price_house)
Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) :
need finite 'ylim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
> quantile(data$Price_house, c(0,0.05,0.1,0.25,0.5,0.75,0.90,0.95,0.99,0.995,1))
0% 5% 10% 25% 50% 75% 90% 95% 99% 99.5% 100%
NA NA NA NA NA NA NA NA NA NA NA
> data2 <- data[data$Price_house <8200, ]
> boxplot(data2$Price_house)
Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) :
need finite 'ylim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
> install.packages()
*/
 
hi i was doing an assignment which Arindham has given,linear regression
I'm getting an error saying Quantpsyc package is not installed,,even I try to install the package I'm not able to do so.
my code:
install.packages()
library(boot)
library(car)
library(Quantpsyc)
library(lmtest)
library(sandwich)
library(vars)
library(nortest)
library(mass)
setwd("D://Brighty")
data<-read.csv("Data.csv")
str(data)
summary(data)
boxplot(data$Price_house)
quantile(data$Price_house, c(0,0.05,0.1,0.25,0.5,0.75,0.90,0.95,0.99,0.995,1))
data2 <- data[data$Price_house <8200, ]
boxplot(data2$Price_house)


this is what I'm getting
/*
library(boot)
> library(car)
> library(Quantpsyc)
Error in library(Quantpsyc) : there is no package called ‘Quantpsyc’
> library(lmtest)
> library(sandwich)
> library(vars)
> library(nortest)
> library(mass)
Error in library(mass) : there is no package called ‘mass’
> setwd("D://Brighty")
> data<-read.csv("Data.csv")
> str(data)
'data.frame': 7071 obs. of 11 variables:
$ Item_Weight : num 9.3 5.92 17.5 19.2 8.93 ...
$ Item_Fat_Content : chr "Low Fat" "Regular" "Low Fat" "Regular" ...
$ Item_Visibility : num 0.016 0.0193 0.0168 0 0 ...
$ Item_Type : chr "Dairy" "Soft Drinks" "Meat" "Fruits and Vegetables" ...
$ Item_MRP : num 249.8 48.3 141.6 182.1 53.9 ...
$ Outlet_Identifier : chr "OUT049" "OUT018" "OUT049" "OUT010" ...
$ Yrs_since_inception : int 17 7 17 18 29 7 29 14 9 17 ...
$ Outlet_Size : chr "Medium" "Medium" "Medium" "Medium" ...
$ Outlet_Location_Type: chr "Tier 1" "Tier 3" "Tier 1" "Tier 3" ...
$ Outlet_Type : chr "Supermarket Type1" "Supermarket Type2" "Supermarket Type1" "Grocery Store" ...
$ sales : num 3735 443 2097 732 995 ...
> summary(data)
Item_Weight Item_Fat_Content Item_Visibility Item_Type Item_MRP Outlet_Identifier
Min. : 4.555 Length:7071 Min. :0.00000 Length:7071 Min. : 31.49 Length:7071
1st Qu.: 8.774 Class :character 1st Qu.:0.02678 Class :character 1st Qu.: 94.14 Class :character
Median :12.600 Mode :character Median :0.05249 Mode :character Median :142.91 Mode :character
Mean :12.858 Mean :0.06397 Mean :141.27
3rd Qu.:16.850 3rd Qu.:0.09278 3rd Qu.:186.01
Max. :21.350 Max. :0.31109 Max. :266.89
NA's :11
Yrs_since_inception Outlet_Size Outlet_Location_Type Outlet_Type sales
Min. : 7.00 Length:7071 Length:7071 Length:7071 Min. : 33.29
1st Qu.: 9.00 Class :character Class :character Class :character 1st Qu.: 920.80
Median :14.00 Mode :character Mode :character Mode :character Median : 1789.67
Mean :15.53 Mean : 2118.39
3rd Qu.:19.00 3rd Qu.: 2966.14
Max. :31.00 Max. :10256.65

> boxplot(data$Price_house)
Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) :
need finite 'ylim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
> quantile(data$Price_house, c(0,0.05,0.1,0.25,0.5,0.75,0.90,0.95,0.99,0.995,1))
0% 5% 10% 25% 50% 75% 90% 95% 99% 99.5% 100%
NA NA NA NA NA NA NA NA NA NA NA
> data2 <- data[data$Price_house <8200, ]
> boxplot(data2$Price_house)
Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) :
need finite 'ylim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
> install.packages()
> library(boot)
> library(car)
> library(Quantpsyc)
Error in library(Quantpsyc) : there is no package called ‘Quantpsyc’
> library(lmtest)
> library(sandwich)
> library(vars)
> library(nortest)
> library(mass)
Error in library(mass) : there is no package called ‘mass’
> setwd("D://Brighty")
> data<-read.csv("Data.csv")
> str(data)
'data.frame': 7071 obs. of 11 variables:
$ Item_Weight : num 9.3 5.92 17.5 19.2 8.93 ...
$ Item_Fat_Content : chr "Low Fat" "Regular" "Low Fat" "Regular" ...
$ Item_Visibility : num 0.016 0.0193 0.0168 0 0 ...
$ Item_Type : chr "Dairy" "Soft Drinks" "Meat" "Fruits and Vegetables" ...
$ Item_MRP : num 249.8 48.3 141.6 182.1 53.9 ...
$ Outlet_Identifier : chr "OUT049" "OUT018" "OUT049" "OUT010" ...
$ Yrs_since_inception : int 17 7 17 18 29 7 29 14 9 17 ...
$ Outlet_Size : chr "Medium" "Medium" "Medium" "Medium" ...
$ Outlet_Location_Type: chr "Tier 1" "Tier 3" "Tier 1" "Tier 3" ...
$ Outlet_Type : chr "Supermarket Type1" "Supermarket Type2" "Supermarket Type1" "Grocery Store" ...
$ sales : num 3735 443 2097 732 995 ...
> summary(data)
Item_Weight Item_Fat_Content Item_Visibility Item_Type Item_MRP Outlet_Identifier
Min. : 4.555 Length:7071 Min. :0.00000 Length:7071 Min. : 31.49 Length:7071
1st Qu.: 8.774 Class :character 1st Qu.:0.02678 Class :character 1st Qu.: 94.14 Class :character
Median :12.600 Mode :character Median :0.05249 Mode :character Median :142.91 Mode :character
Mean :12.858 Mean :0.06397 Mean :141.27
3rd Qu.:16.850 3rd Qu.:0.09278 3rd Qu.:186.01
Max. :21.350 Max. :0.31109 Max. :266.89
NA's :11
Yrs_since_inception Outlet_Size Outlet_Location_Type Outlet_Type sales
Min. : 7.00 Length:7071 Length:7071 Length:7071 Min. : 33.29
1st Qu.: 9.00 Class :character Class :character Class :character 1st Qu.: 920.80
Median :14.00 Mode :character Mode :character Mode :character Median : 1789.67
Mean :15.53 Mean : 2118.39
3rd Qu.:19.00 3rd Qu.: 2966.14
Max. :31.00 Max. :10256.65

> boxplot(data$Price_house)
Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) :
need finite 'ylim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
> quantile(data$Price_house, c(0,0.05,0.1,0.25,0.5,0.75,0.90,0.95,0.99,0.995,1))
0% 5% 10% 25% 50% 75% 90% 95% 99% 99.5% 100%
NA NA NA NA NA NA NA NA NA NA NA
> data2 <- data[data$Price_house <8200, ]
> boxplot(data2$Price_house)
Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) :
need finite 'ylim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
> install.packages()
*/
hi Brighty

wow you did so many things. good I am still trying these code.

I think you need to install first the where it is showing error like [Error in library(Quantpsyc) : there is no package called ‘Quantpsyc’]

I first install the Quantpsyc package with the code - install.packages("Quantpsyc") . "" is important to put in bracket.

hope this helps

I am still doing the task.

good luck to you and share the codes if you crack it :)
 
Hey Guys,
I have created a WhatsApp Group where we can discuss the ideas and solve problems, if any body interested to join in this group please post your contact number I will add into the group..
 

Brighty

Member
hi Brighty

wow you did so many things. good I am still trying these code.

I think you need to install first the where it is showing error like [Error in library(Quantpsyc) : there is no package called ‘Quantpsyc’]

I first install the Quantpsyc package with the code - install.packages("Quantpsyc") . "" is important to put in bracket.

hope this helps

I am still doing the task.

good luck to you and share the codes if you crack it :)
hi Sanjay
Thanks for your response
but why no teaching assistant is helping us in cracking these codes.
i need their help to complete my project and assignment
 
hi Sanjay
Thanks for your response
but why no teaching assistant is helping us in cracking these codes.
i need their help to complete my project and assignment
that's right I am also wondering in our group no assistance is there. and other group member also do not response. but in other group people really communicate to each other and that's really helpful.
 
Categorize the average of grade point into High, Medium, and Low (with admission probability percentages) and plot it on a point chart.
im a little confused here in the project guys,could anyone help?
 

Brighty

Member
can anyone say what actually we need to do in Project 5 given in LMS R programming
setwd("D://Brighty")
data<-read.csv("College_admission.csv")
str(data)
summary(data)
table(data$admit)

library(caTools)
set.seed(88)
split = sample.split(data$admit, SplitRatio = 0.75)
split


qualityTrain = subset(data, split == TRUE)
qualityTest = subset(data, split == FALSE)
QualityLog = glm(admit ~ gre + gpa + rank, data=qualityTrain, family=binomial)
summary(QualityLog)
predictTrain = predict(QualityLog, type="response")
summary(predictTrain)
tapply(predictTrain, qualityTrain$admit, mean)
table(qualityTrain$admit, predictTrain > 0.5)
table(qualityTrain$admit, predictTrain > 0.7)
table(qualityTrain$admit, predictTrain > 0.2)


this is the thing I have done so far,,how do we need to proceed further
 
Top