Você está na página 1de 9

Tarefa 01 - Estatística descritiva

Discente: Vinícius Gonzaga de Oliveira (12222CCP026)

Uberlândia, 02 de setembro de 2022

Setup

library(tidyverse)

## -- Attaching packages --------------------------------------- tidyverse 1.3.2 --


## v ggplot2 3.3.6 v purrr 0.3.4
## v tibble 3.1.8 v dplyr 1.0.9
## v tidyr 1.2.0 v stringr 1.4.0
## v readr 2.1.2 v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()

library(kableExtra)

##
## Attaching package: ’kableExtra’
##
## The following object is masked from ’package:dplyr’:
##
## group_rows

Import dataset

tabela_cost <- read_delim("cost_analysis_task_01.csv")

## Rows: 180 Columns: 5


## -- Column specification --------------------------------------------------------
## Delimiter: ","
## chr (2): clients, size
## dbl (3): positions, paid, discount
##
## i Use ‘spec()‘ to retrieve the full column specification for this data.
## i Specify the column types or set ‘show_col_types = FALSE‘ to quiet this message.

1
kbl(head(tabela_cost,5),
"simple",
align = "llccc",
caption = "Preço de um software no 1TRI2022 (plot dos 5 primeiros)",
col.names = c('Clientes','Porte','Posições','Valor pago (R$)','Desconto'))

Table 1: Preço de um software no 1TRI2022 (plot dos 5 primeiros)

Clientes Porte Posições Valor pago (R$) Desconto


Cliente_1 small 70 1700.00 0.213
Cliente_2 small 50 1383.09 0.125
Cliente_3 small 50 1329.42 0.081
Cliente_4 medium 120 1903.20 0.062
Cliente_5 small 50 1300.00 0.057

Medidas de tendência central e variabilidade

resumo_geral <- tabela_cost |>


group_by(size) |>
summarise(qtd = n(),
média1 = round(mean(positions),2),
moda1 = round(median(positions),2),
desvio1 = round(sd(positions),2),
média2 = round(mean(paid),2),
moda2 = round(median(paid),2),
desvio2 = round(sd(paid),2),
média3 = round(mean(discount),2),
moda3 = round(median(discount),2),
desvio3 = round(sd(discount),2))

kbl(resumo_geral,
align = "lcccccccccc",
caption="Quadro resumido das vendas por tamanho de cliente no 1TRI2022",
col.names=c('Porte','Qtd.','Me','Mo','dp','Me','Mo','desvio','Me','Mo','dp')) |>
footnote(number = c("Me = média", "Mo = moda", "dp = desvio padrão")) |>
add_header_above(c(" "=1," "=1,"Posições"=3,"Valor pago (R$)"=3,"Disconto aplicado"=3)) |>
kable_styling(latex_options = "HOLD_position")

Table 2: Quadro resumido das vendas por tamanho de cliente no 1TRI2022

Posições Valor pago (R$) Disconto aplicado


Porte Qtd. Me Mo dp Me Mo desvio Me Mo dp
medium 25 101.2 100 13.01 1436.83 1391.59 234.22 -0.13 -0.15 0.12
small 155 63.1 50 63.47 1139.09 1100.00 332.92 -0.13 -0.15 0.13
1
Me = média
2
Mo = moda
3
dp = desvio padrão

2
Boxplot

ggplot(tabela_cost, aes(positions, size)) + geom_boxplot()

small
size

medium

200 400 600


positions

ggplot(tabela_cost, aes(paid, size)) + geom_boxplot()

small
size

medium

1000 2000 3000 4000


paid

3
ggplot(tabela_cost, aes(discount, size)) + geom_boxplot()

small
size

medium

−0.75 −0.50 −0.25 0.00 0.25


discount
##
Density

ggplot(tabela_cost, aes(positions)) + geom_density()

0.12

0.09
density

0.06

0.03

0.00

200 400 600


positions

4
ggplot(tabela_cost, aes(paid)) + geom_density()

0.003

0.002
density

0.001

0.000

1000 2000 3000 4000


paid

ggplot(tabela_cost, aes(discount)) + geom_density()

3
density

−0.75 −0.50 −0.25 0.00 0.25


discount
##

5
Dataset

kbl(tabela_cost,
"simple",
align = "llccc",
caption = "Preço de um software no 1TRI2022 (plot dos 5 primeiros)",
col.names = c('Clientes','Porte','Posições','Valor pago (R$)','Desconto'))

Table 3: Preço de um software no 1TRI2022 (plot dos 5 primeiros)

Clientes Porte Posições Valor pago (R$) Desconto


Cliente_1 small 70 1700.00 0.213
Cliente_2 small 50 1383.09 0.125
Cliente_3 small 50 1329.42 0.081
Cliente_4 medium 120 1903.20 0.062
Cliente_5 small 50 1300.00 0.057
Cliente_6 small 50 1250.00 0.017
Cliente_7 small 50 1250.00 0.017
Cliente_8 small 50 1250.00 0.017
Cliente_9 small 50 1250.00 0.017
Cliente_10 small 50 1250.00 0.017
Cliente_11 small 50 1250.00 0.017
Cliente_12 small 50 1250.00 0.017
Cliente_13 medium 120 1800.00 0.005
Cliente_14 medium 100 1640.00 0.002
Cliente_15 small 50 1230.00 0.000
Cliente_16 small 50 1230.00 0.000
Cliente_17 small 50 1230.00 0.000
Cliente_18 small 50 1230.00 0.000
Cliente_19 small 50 1230.00 0.000
Cliente_20 small 120 1792.00 0.000
Cliente_21 medium 100 1637.17 0.000
Cliente_22 medium 100 1637.17 0.000
Cliente_23 medium 100 1637.17 0.000
Cliente_24 medium 100 1637.17 0.000
Cliente_25 small 50 1229.42 0.000
Cliente_26 small 50 1229.42 0.000
Cliente_27 small 50 1229.42 0.000
Cliente_28 small 50 1229.42 0.000
Cliente_29 medium 120 1791.25 0.000
Cliente_30 small 50 1229.42 0.000
Cliente_31 small 50 1229.41 0.000
Cliente_32 small 50 1229.41 0.000
Cliente_33 small 50 1229.41 0.000
Cliente_34 small 50 1229.40 0.000
Cliente_35 small 50 1229.17 0.000
Cliente_36 small 50 1250.00 0.017
Cliente_37 small 50 1230.00 0.000
Cliente_38 small 50 1250.00 0.017
Cliente_39 small 50 1250.00 0.017
Cliente_40 small 50 1250.00 0.017
Cliente_41 small 50 1200.00 -0.024

6
Clientes Porte Posições Valor pago (R$) Desconto
Cliente_42 small 50 1230.00 0.000
Cliente_43 small 70 1400.00 -0.001
Cliente_44 small 50 1210.00 -0.016
Cliente_45 small 50 1200.00 -0.024
Cliente_46 small 50 1200.00 -0.024
Cliente_47 small 50 1200.00 -0.024
Cliente_48 small 50 1200.00 -0.024
Cliente_49 small 50 1200.00 -0.024
Cliente_50 small 50 1200.00 -0.024
Cliente_51 small 50 1200.00 -0.024
Cliente_52 small 50 1200.00 -0.024
Cliente_53 small 50 1187.50 -0.034
Cliente_54 small 110 1628.50 -0.050
Cliente_55 medium 100 1555.31 -0.050
Cliente_56 small 50 1000.00 -0.187
Cliente_57 small 50 1167.00 -0.051
Cliente_58 small 50 1167.00 -0.051
Cliente_59 small 50 1167.00 -0.051
Cliente_60 small 50 1167.00 -0.051
Cliente_61 small 100 1540.00 -0.059
Cliente_62 small 50 1150.00 -0.065
Cliente_63 small 50 1129.00 -0.082
Cliente_64 small 50 1106.48 -0.100
Cliente_65 small 50 1100.00 -0.105
Cliente_66 small 60 1200.00 -0.088
Cliente_67 small 50 1110.00 -0.097
Cliente_68 small 100 1476.00 -0.098
Cliente_69 small 50 1108.00 -0.099
Cliente_70 small 50 1107.00 -0.100
Cliente_71 small 50 1107.00 -0.100
Cliente_72 small 50 1107.00 -0.100
Cliente_73 small 70 1261.80 -0.100
Cliente_74 small 50 1106.48 -0.100
Cliente_75 small 50 1106.48 -0.100
Cliente_76 small 50 1106.48 -0.100
Cliente_77 medium 120 1612.13 -0.100
Cliente_78 medium 100 1473.45 -0.100
Cliente_79 small 50 1100.00 -0.105
Cliente_80 small 50 1100.00 -0.105
Cliente_81 small 50 1100.00 -0.105
Cliente_82 small 50 1100.00 -0.105
Cliente_83 small 50 1100.00 -0.105
Cliente_84 small 600 4635.00 -0.111
Cliente_85 small 50 1067.50 -0.132
Cliente_86 small 50 1045.00 -0.150
Cliente_87 small 50 1052.00 -0.144
Cliente_88 small 50 1050.00 -0.146
Cliente_89 small 50 1050.00 -0.146
Cliente_90 small 50 1050.00 -0.146
Cliente_91 small 50 1050.00 -0.146
Cliente_92 small 50 1050.00 -0.146
Cliente_93 small 50 1050.00 -0.146

7
Clientes Porte Posições Valor pago (R$) Desconto
Cliente_94 small 50 1050.00 -0.146
Cliente_95 small 50 1045.50 -0.150
Cliente_96 small 50 1045.50 -0.150
Cliente_97 small 100 1392.00 -0.150
Cliente_98 medium 100 1391.59 -0.150
Cliente_99 medium 100 1391.59 -0.150
Cliente_100 small 50 1045.00 -0.150
Cliente_101 small 50 1045.00 -0.150
Cliente_102 small 50 1045.00 -0.150
Cliente_103 small 50 1045.00 -0.150
Cliente_104 small 85 1293.36 -0.150
Cliente_105 small 50 1045.00 -0.150
Cliente_106 small 50 1045.00 -0.150
Cliente_107 small 50 1045.00 -0.150
Cliente_108 small 50 1045.00 -0.150
Cliente_109 small 50 1045.00 -0.150
Cliente_110 small 50 1045.00 -0.150
Cliente_111 small 50 1045.00 -0.150
Cliente_112 small 50 1045.00 -0.150
Cliente_113 small 50 1045.00 -0.150
Cliente_114 small 50 1045.00 -0.150
Cliente_115 small 50 1045.00 -0.150
Cliente_116 small 50 1045.00 -0.150
Cliente_117 small 50 1045.00 -0.150
Cliente_118 small 50 1045.00 -0.150
Cliente_119 small 100 1391.00 -0.150
Cliente_120 medium 100 1390.00 -0.151
Cliente_121 small 50 1050.00 -0.146
Cliente_122 small 75 1200.00 -0.169
Cliente_123 medium 100 1300.00 -0.206
Cliente_124 small 50 1014.27 -0.175
Cliente_125 small 50 1013.65 -0.176
Cliente_126 small 50 1000.00 -0.187
Cliente_127 small 50 1000.00 -0.187
Cliente_128 small 50 1000.00 -0.187
Cliente_129 small 50 1000.00 -0.187
Cliente_130 small 50 1000.00 -0.187
Cliente_131 small 50 1000.00 -0.187
Cliente_132 small 50 1000.00 -0.187
Cliente_133 small 50 1000.00 -0.187
Cliente_134 small 50 1000.00 -0.187
Cliente_135 small 50 1000.00 -0.187
Cliente_136 small 50 1000.00 -0.187
Cliente_137 small 50 1000.00 -0.187
Cliente_138 small 50 1000.00 -0.187
Cliente_139 small 50 1000.00 -0.187
Cliente_140 small 50 1000.00 -0.187
Cliente_141 small 50 1000.00 -0.187
Cliente_142 small 50 1000.00 -0.187
Cliente_143 small 50 1000.00 -0.187
Cliente_144 small 50 1000.00 -0.187
Cliente_145 small 50 1000.00 -0.187

8
Clientes Porte Posições Valor pago (R$) Desconto
Cliente_146 small 50 1000.00 -0.187
Cliente_147 small 50 1000.00 -0.187
Cliente_148 small 60 1000.00 -0.240
Cliente_149 medium 100 1309.74 -0.200
Cliente_150 small 50 1200.00 -0.024
Cliente_151 small 50 1000.00 -0.187
Cliente_152 medium 100 1300.00 -0.206
Cliente_153 medium 100 1300.00 -0.206
Cliente_154 small 60 1000.00 -0.240
Cliente_155 small 50 1050.00 -0.146
Cliente_156 medium 50 1150.00 -0.065
Cliente_157 small 50 900.00 -0.268
Cliente_158 medium 100 1250.00 -0.236
Cliente_159 medium 100 1040.00 -0.365
Cliente_160 small 150 1510.00 -0.250
Cliente_161 medium 100 1227.88 -0.250
Cliente_162 medium 100 1200.00 -0.267
Cliente_163 medium 100 1200.00 -0.267
Cliente_164 small 50 1050.00 -0.146
Cliente_165 medium 100 1146.02 -0.300
Cliente_166 small 50 750.00 -0.390
Cliente_167 small 50 850.00 -0.309
Cliente_168 small 50 750.00 -0.390
Cliente_169 small 50 750.00 -0.390
Cliente_170 small 50 800.00 -0.349
Cliente_171 small 100 1050.00 -0.359
Cliente_172 small 50 680.00 -0.447
Cliente_173 small 100 1000.00 -0.389
Cliente_174 small 50 750.00 -0.390
Cliente_175 small 50 750.00 -0.390
Cliente_176 small 50 750.00 -0.390
Cliente_177 small 60 800.00 -0.392
Cliente_178 small 60 750.00 -0.430
Cliente_179 small 400 1640.00 -0.569
Cliente_180 small 480 1000.00 -0.771

Você também pode gostar