Escolar Documentos
Profissional Documentos
Cultura Documentos
1
2
2
3
4
5
6
(30,40]
(40,50]
(50,60]
(60,70]
(70,80]
26
32
15
6
3
Answer 2
Answer 3 Most of the buyers are in the range from $25 to $75 for both promotional
and regular customers.
sales.cut
CustomerType (0,25] (25,50] (50,75] (75,100] (100,125] (125,150] (150,175] (175,200]
(200,225]
Promotional
7
17
17
8
9
3
2
3
0
Regular
3
12
9
1
3
1
1
0
0
sales.cut
CustomerType (225,250] (250,275] (275,300]
Promotional
1
2
1
Regular
0
0
0
Answer 4
//Solution1
Items.freq=data.frame(table(Items))
names(Items.freq)=c("Items Purchased", "Frequency")
Items.freq
mop.freq=data.frame(table(PaymentMethod))
names(mop.freq)=c("Methods of Payment","Percentage Frequency")
mop.freq
gender.freq=data.frame(table(Gender))
names(gender.freq)=c("Gender" , "Percentage Frequency")
gender.freq
ct.freq=data.frame(table(CustomerType))
names(ct.freq)=c("Customer Type","Percentage Frequency")
ct.freq
marital.freq=data.frame(table(MaritalStatus))
names(marital.freq)=c("Marital Status","Percentage Frequency")
marital.freq
range(Age)
range(NetSales)
break1=seq(20,80,by=10)
break1
age.freq=data.frame(table(cut(Age,break1)))
names(age.freq)=c("Age Range","Percentage Frequency")
age.freq
break2=seq(0,300, by=25)
sale.freq=data.frame(table(cut(NetSales,break2)))
names(sale.freq)=c("Net Sales ($)","Percentage Frequency")
sale.freq
//Solution2
mop.barplot=ggplot(mydata, aes(x=PaymentMethod, y=Items))
mop.barplot+geom_bar(stat="identity")+labs(x="Method of Payment", y="Item
Count")
//solution3
sales.cut=cut(NetSales,break2)
crosstab1=table(CustomerType,sales.cut)
crosstab1
//solution4
plot(Age, NetSales, main="Age Vs Netsales", xlab="Age of Buyer", ylab="Sales in
Dollars", pch=20, ylim=c(0,250))