Professional Documents
Culture Documents
1240 AE-311
A. i. Problem: Construct a table showing the given data's frequency, relative frequency, and percent frequency
distribution.
ii. Rscript:
install.packages(“readr”)
install.packages(“pander”)
library(readr)
library(pander)
Vehicle<-read.csv("Vehicle.csv")
Vehicle
View(Vehicle)
Vehicle.freq <-table(Vehicle)
Vehicle.freq
freq.dist<-cbind(Vehicle.freq)
freq.dist
colnames(freq.dist)<-c("Frequency")
freq.dist
pander(freq.dist)
Vehicle.relfreq<-(Vehicle.freq/sum(Vehicle.freq))
Vehicle.relfreq
Vehicle.percent
Vehicle.percent)
Vehicle.fredist
Vehicle.fredist
pander(Vehicle.fredist)
iii. Output
B. i. Problem: Construct a bar chart and a pie chart for the sample.
ii. R Script:
install.packages("tidyverse")
install.packages("forcats")
install.packages("readr")
library(readr)
library(tidyverse)
library(forcats)
Vehicle<-read.csv("Vehicle.csv")
Vehicle
bar1<-ggplot(Vehicle,
aes(x=Vehicle))+geom_bar(width=0.5)+ggtitle("Vehicle Purchases")
bar1
bar2<-
ggplot(mutate(Vehicle,Vehicle=fct_infreq(Vehicle)))+geom_bar(ae
library(readr)
Vehicle <-read.csv("Vehicle.csv")
Vehicle
data.freq <-table(Vehicle)
data.freq
freq
label
percent <-round(freq/sum(freq)*100,1)
percent
label
label
col=rainbow(length(label)),main="Pie
iii. Output
BAR 1
BAR 2
iv. Interpretation
The graph shows that Ford got the highest frequency of 28%, which means that it is the most frequently used vehicle
during the last five years at a particular car leadership. Then followed by Suzuki, who got 26% and is relatively close to
Ford with just 2%, this means that Ford and Suzuki have the most reliable amount and quality for the dealership, which is
worth purchasing to the customers. Toyota got 20% which is sought to be in an average purchase frequency for customers.
While Honda covered 14% and Mitsubishi for 12%, this implies that Honda and Mitsubishi do not have enough capacity in
a car dealership and that fewer customers are satisfied with its quality, cost of ownership, and reliability.
2. The data below shows the time in days required to complete year-end audits for a sample of 20 clients of Sanderson
and Clifford, a small public accounting firm.
i. Problem: Construct a dot plot for the sample.
ii. R Script:
install.packages("ggplot2")
library(readr)
library(ggplot2)
Audit<-read.csv("Audit.csv")
Audit
plot
iii. Output
iv. Interpretation
Twenty clients of Sanderson and Clifford were used as sample data to know the required days to complete year-end audits
of a small public accounting firm. The graph shows that the maximum repetition of audit time in days is three times; thus,
there is no audit repetition exceeding three times per day in the client's record. The measures of its central tendency have
a mode of 18. 18 (time in days) has the maximum number of repetitions while 14, 15, and 22 were repeated twice, and
the rest has not a repetition of an audit.
3. The dividend yield is the annual dividend paid by a company expressed as a percentage of the stock price
(Dividend/Stock Price x 100). The dividend yields for the top dividend-paying stocks in the Philippines for 2021 is shown in
Table 5.17.
A. i. Problem: Construct a table showing the grouped frequency distribution and percent frequency distribution.
ii. R Script
install.packages("readr")
install.packages("pander")
library(readr)
library(pander)
Dividend<-read.csv("Dividend.csv")
Dividend
View(Dividend)
breaks
classint
div.freq<-table(classint)
div.freq
div.relfreq<-div.freq/sum(div.freq)
div.relfreq
div.pctfreq<-div.relfreq*100
div.pctfreq
div.freqdist<-cbind(div.freq,div.pctfreq)
div.freqdist
colnames(div.freqdist)<-c("Grouped Frequency","Percent
Frequency (%)")
div.freqdist
pander(div.freqdist)
iii. Output
B. i. Problem: Construct a frequency histogram.
ii. R Script
library(readr)
data <-read.csv("Dividend.csv")
data
iii. Output
iv. Interpretation
33 companies were used as a sample to determine which of these companies’ dividend yields for the top dividend paying
stocks in the Philippines for 2021. The first table shows that the most percentage of a group having a dividend yield of
0.26 to 1.57 got the highest percent frequency of 45.45% with a fraction of 15/33 companies. Most companies under
45.45% are the most significant and most prominent and influential multi-company in the Philippines. The companies with
a range of 1.57 to 2.88 dividend covered 33.33%, companies who fall in between 2.88 to 4.19, 5.5 to 6.81, and 6.81 to 8.12
with a fraction of 2 companies out of 33 got 6.061% while the lowest percent frequency of 3.03% falls under the only
company who fall in between the range of 6.81 to 8.12 dividend yield.