Capítulo 10 Exercícios extras

Questão 1.1

(Adaptada de Maindonald (2010)) Os dados a seguir são referentes ao tamanho da área (ha) e ao preço ($AU, dólar australiano \(\times 1000\)), para 15 casas vendidas no subúrbio de Aranda em Canberra (Austrália) em 1999.

area <- c(694,905,802,1366,716,963,821,714,1018,887,790,696,771,1006,1191)
preco <- c(192.0,215.0,215.0,274.0,112.7,185.0,212.0,220.0,276.0,260.0,221.5,
           255.0,260.0,293.0,375.0)
  1. Use a função str() para obter informações das colunas. Compare com a função dplyr::glimpse.
  2. Plote preco versus area.
  3. Use o comando hist() para traçar um histograma dos preços de venda.
  4. Calcule as principais medidas de posição das duas varáveis.
  5. Calcule as principais medidas de dispersão das duas varáveis.

Questão 2.1

(Adaptada de Sarstedt & Mooi (2019,3rd), p. 105) Teste se há uma relação significativa entre as (não) respostas dos entrevistados de uma determinada variável e sua renda.

Baixa renda Média renda Alta Renda
Resposta
 65
 95
70
Não resposta
 35
 5
30

Questão 3.1

Considere o website https://www.oddjobairways.com/, planejado para ser usado como estudo de caso por (Sarstedt and Mooi 2019), bem como o banco de dados Oddjob.sav disponível em https://www.guide-market-research.com/spss/downloads/. Utilize nível de significância \(\alpha=0.05\).

  1. Faça uma análise dos metadados da Tabela 5.5 apresentada nas páginas 122 e 123, bem como do objeto rotulos criado no código a seguir.
  2. Faça uma análise descritiva das variáveis do banco de dados, contemplando tabelas e gráficos que você julgar interessantes. Utilize o R/RStudio bem como outra ferramenta, como PSPP ou JASP.
  3. Verifique se existe diferença significativa nas idades (age) dos passageiros homens e mulheres (gender).
  4. Verifique se existe diferença significativa entre as classes dos passageiros (flight_class) homens e mulheres (gender).
  5. Realize outras análises que julgar interessantes considerando os dados disponíveis.
# bibliotecas
suppressMessages(library(foreign))
suppressMessages(library(tidyverse))

# baixando
URL <- 'https://www.guide-market-research.com/app/download/13631503227/Oddjob.sav?t=1537365622'
oddjob <- suppressWarnings(read.spss(URL, to.data.frame = T))

# obtendo rótulos
rotulos <- attr(oddjob, 'variable.labels')

# convertendo em tibble
oddjob <- as_tibble(oddjob)

# dando uma olhada
class(oddjob)
## [1] "tbl_df"     "tbl"        "data.frame"
dim(oddjob)
## [1] 1065   71
glimpse(oddjob)
## Rows: 1,065
## Columns: 71
## $ country        <fct> Switzerland, Switzerland, Switzerland, France, Switzerland, Switzerland, Switzerland, Switzerl…
## $ language       <fct> French, English, English, French, English, German, French, French, French, German, German, Ger…
## $ status         <fct> Blue, Gold, Blue, Blue, Gold, Gold, Blue, Gold, Blue, Gold, Silver, Blue, Blue, Gold, Silver, …
## $ age            <dbl> 30, 55, 56, 43, 44, 40, 39, 41, 33, 51, 49, 49, 58, 49, 53, 53, 59, 22, 46, 38, 54, 48, 77, 50…
## $ gender         <fct> male, male, female, female, female, male, male, male, male, male, female, female, female, fema…
## $ nflights       <dbl> 2, 6, 8, 7, 25, 16, 35, 9, 3, 4, 18, 2, 2, 20, 18, 3, 10, 3, 23, 6, 50, 15, 13, 30, 35, 20, 20…
## $ flight_latest  <fct> within the last 6 months, within the last 3 months, within the last month, within the last 3 m…
## $ flight_type    <fct> Domestic, International, Domestic, Domestic, International, International, Domestic, Internati…
## $ flight_purpose <fct> Private, Business, Business, Private, Business, Private, Business, Business, Private, Business…
## $ flight_class   <fct> Economy, Business, Economy, Economy, Business, First, Economy, Business, Economy, Business, Ec…
## $ nps            <fct> 6, very likely, 8, 8, 6, 7, 8, 7, 8, 8, 9, very likely, 8, very likely, 6, 8, very unlikely, 8…
## $ reputation     <fct> 4, Fully agree, 5, Fully agree, 6, 4, 4, 5, 3, 5, Fully agree, Fully agree, 5, 5, Fully agree,…
## $ sat1           <fct> 6, Fully agree, 5, Fully agree, 5, Fully disagree, Fully agree, 6, 5, 5, 6, Fully agree, 5, 5,…
## $ sat2           <fct> 3, Fully agree, 3, Fully agree, 4, 3, 4, 4, 5, 5, 6, Fully agree, 5, Fully agree, 5, 5, Fully …
## $ sat3           <fct> 5, Fully agree, 3, 5, 3, Fully disagree, 6, 5, 5, 4, 6, Fully agree, 3, 5, 4, 4, Fully disagre…
## $ overall_sat    <fct> 3, Fully agree, 3, 5, 3, 5, 5, 5, 5, 4, 5, Fully agree, 2, 5, 3, 6, 5, 5, 5, 3, 3, Fully disag…
## $ loy1           <fct> 4, Fully agree, 4, Fully agree, 4, 3, 3, 5, 5, 4, 6, Fully agree, 5, Fully agree, 4, 6, Fully …
## $ loy2           <fct> 4, Fully agree, 5, 5, 4, 4, Fully disagree, 5, 5, 5, 6, Fully agree, 5, Fully agree, 4, 6, Ful…
## $ loy3           <fct> 4, Fully agree, Fully disagree, 6, 3, 3, Fully disagree, 5, 3, 4, 6, Fully agree, 5, Fully agr…
## $ loy4           <fct> Fully disagree, 6, 3, 5, 3, 4, Fully disagree, 6, 2, 4, Fully agree, Fully agree, 4, Fully agr…
## $ loy5           <fct> 4, Fully agree, 5, 6, 3, 3, Fully agree, 6, 3, 5, 6, Fully agree, 5, Fully agree, Fully agree,…
## $ com1           <fct> 2, Fully agree, Fully disagree, Fully agree, 4, Fully disagree, Fully disagree, 5, 4, 2, 6, Fu…
## $ com2           <fct> 2, Fully agree, Fully disagree, Fully agree, 4, Fully agree, Fully disagree, 5, 4, Fully disag…
## $ com3           <fct> Fully disagree, Fully agree, Fully disagree, Fully agree, 3, 4, Fully disagree, 6, 4, Fully di…
## $ e1             <fct> 76, Very high, Very high, Very high, 70, Very high, Very high, 97, Very high, 94, Very high, V…
## $ s1             <fct> 50, Very satisfied, 50, 83, 38, Very satisfied, Very unsatisfied, 94, 89, 50, 87, Very satisfi…
## $ e2             <fct> 86, Very high, Very high, 85, 69, Very high, Very high, 84, Very high, 80, Very high, Very hig…
## $ s2             <fct> 75, Very satisfied, 50, 81, 40, 50, 72, 82, Very satisfied, 50, 84, Very satisfied, 30, 25, 85…
## $ e3             <fct> 84, Very high, Very high, 99, 76, Very high, Very high, 78, Very high, 59, 99, Very high, Very…
## $ s3             <fct> 50, 97, 50, 63, 36, Very unsatisfied, Very unsatisfied, 74, 68, 33, 82, 89, 15, 51, 73, 42, Ve…
## $ e4             <fct> 90, Very high, Very high, 97, 84, Very high, Very high, Very high, Very high, 94, Very high, V…
## $ s4             <fct> 80, Very satisfied, 50, 83, 38, Very satisfied, Very unsatisfied, 70, 81, 50, 93, Very satisfi…
## $ e5             <fct> 83, 97, Very high, 87, 88, Very high, 82, Very high, Very high, 91, 93, Very high, Very high, …
## $ s5             <fct> 21, 98, Very unsatisfied, 63, 42, 43, 57, 62, 73, 57, 92, Very satisfied, 40, 50, 63, 77, 6, 5…
## $ e6             <fct> 81, 97, Very high, 86, 86, Very high, Very high, Very high, Very high, 90, 84, Very high, Very…
## $ s6             <fct> 21, 98, Very unsatisfied, 63, 42, 60, 82, 65, 77, 54, 80, Very satisfied, 20, 50, 65, 88, 89, …
## $ e7             <fct> 88, 99, Very high, 98, 91, Very high, 86, Very high, Very high, 98, 91, Very high, Very high, …
## $ s7             <fct> 16, 99, Very unsatisfied, 60, 44, 50, 42, 66, 69, 63, 70, 92, 36, 50, 61, 36, 60, 52, 58, 49, …
## $ e8             <fct> 82, 94, 70, 87, 82, Very high, 88, 98, Very high, 61, 85, Very high, Very high, 78, 72, 93, 71…
## $ s8             <fct> 38, 94, 36, 72, 62, 49, 54, 67, 69, 73, 86, 97, 26, 50, 73, 81, 60, 63, 73, 36, 57, 35, 96, 50…
## $ e9             <fct> 89, Very high, NA, Very high, 56, Very high, Very high, 96, Very high, 56, Very high, Very hig…
## $ s9             <fct> 73, Very satisfied, NA, 73, 55, 47, 81, 94, 76, 50, 93, 93, 82, 50, 84, 72, 68, 95, 89, 50, 82…
## $ e10            <fct> 77, 99, Very high, Very high, 57, Very high, Very high, 96, Very high, 54, Very high, Very hig…
## $ s10            <fct> 50, 96, Very unsatisfied, 77, 52, Very satisfied, 83, 87, 65, 50, 86, 94, 45, 50, 81, 50, 61, …
## $ e11            <fct> 87, Very high, Very high, Very high, 62, Very high, Very high, 88, Very high, 70, Very high, V…
## $ s11            <fct> 24, Very satisfied, Very unsatisfied, 69, 58, 47, 73, 77, 38, 50, 84, 92, 64, 61, 79, 70, 85, …
## $ e12            <fct> 30, Very high, NA, Very high, NA, Very high, Very high, 77, Very high, 57, 94, Very high, Very…
## $ s12            <fct> 50, Very satisfied, NA, 60, NA, Very satisfied, 62, 76, 78, 50, 76, 94, 75, 50, 77, 53, 78, 78…
## $ e13            <fct> 87, 98, 67, Very high, 52, Very high, Very high, 89, Very high, 77, 88, Very high, 99, Very hi…
## $ s13            <fct> 30, 97, 10, 69, 51, 93, 82, 87, 61, 32, 80, 94, 45, 47, 82, 42, 63, 85, 56, 50, 73, 47, 96, 37…
## $ e14            <fct> 89, 90, 58, 87, 82, Very high, 84, 94, Very high, 53, 86, Very high, 41, Very high, 67, 93, 99…
## $ s14            <fct> 50, 88, 51, 69, 42, Very unsatisfied, Very unsatisfied, 74, 65, 50, 82, 93, 32, 43, 64, 71, Ve…
## $ e15            <fct> 87, 98, Very high, Very high, 80, Very high, 70, Very high, Very high, 72, 73, Very high, 28, …
## $ s15            <fct> 18, 97, Very unsatisfied, 13, 36, 48, 39, 80, 33, 50, 49, 90, 24, 50, 90, 84, 65, 72, 62, 36, …
## $ e16            <fct> 90, 99, 50, 81, 80, Very high, 83, Very high, Very high, 62, 51, Very high, Very high, 53, 72,…
## $ s16            <fct> 77, 98, 50, 70, 46, 71, 26, 72, 40, 61, 50, Very satisfied, 26, 50, 66, 70, 89, 86, 67, 44, 69…
## $ e17            <fct> 89, 86, 92, Very high, 83, Very high, 84, Very high, Very high, 59, 85, Very high, 87, Very hi…
## $ s17            <fct> 78, 86, 10, 73, 40, 39, 59, 80, 64, 55, 82, Very satisfied, 82, 46, 63, 51, 12, 79, 61, 41, 76…
## $ e18            <fct> 85, 94, 98, Very high, 71, Very high, 99, Very high, Very high, 61, 89, Very high, Very high, …
## $ s18            <fct> 50, 96, 38, 70, 42, 42, 39, 68, 80, 58, 83, Very satisfied, 65, 41, 63, 48, 32, 78, 68, 39, 60…
## $ e19            <fct> 88, 98, 49, Very high, 83, Very high, 82, Very high, Very high, 50, 74, Very high, Very high, …
## $ s19            <fct> 50, 97, 44, 39, 41, 47, 67, 76, 68, 50, 71, 99, 57, 50, 54, 49, 48, 81, 70, 50, 69, 29, NA, 48…
## $ e20            <fct> 90, 97, 67, Very high, 77, Very high, 76, Very high, Very high, 50, 71, Very high, Very high, …
## $ s20            <fct> 50, 96, 25, 84, 54, 35, 78, 77, 77, 50, 50, Very satisfied, 95, 28, 66, 64, 13, 77, 77, 41, 57…
## $ e21            <fct> 76, Very high, 98, 82, 76, Very high, 99, 92, Very high, NA, 97, 97, Very high, 68, 72, 99, 58…
## $ s21            <fct> 50, Very satisfied, 49, 87, 44, 24, 57, 73, 70, NA, 95, 95, 77, 43, 76, 43, 9, 67, 80, 45, 61,…
## $ e22            <fct> 78, 93, 32, 70, 92, 81, 69, 98, Very high, 58, 82, Very high, 54, 59, 63, 42, NA, 84, 67, 30, …
## $ s22            <fct> 27, 95, 32, 43, 38, 49, 43, 37, 66, 50, 74, Very satisfied, 55, 50, 63, 57, NA, 85, 64, 50, 59…
## $ e23            <fct> 83, 87, 29, 96, 84, 61, Very high, 90, Very high, 74, 96, 95, Very high, Very high, 63, 88, 82…
## $ s23            <fct> 21, 84, 50, 71, 39, 42, 49, 53, 33, 40, 50, 96, 36, 38, 34, 84, 55, 67, 67, 40, 30, 21, 79, 44…
## $ commitment     <dbl> 1.67, 7.00, 1.00, 7.00, 3.67, 4.00, 1.00, 5.33, 4.00, 1.33, 4.67, 6.33, 3.33, 7.00, 3.33, 7.00…
DT::datatable(oddjob)

Referências

Sarstedt, Marko, and Erik Mooi. 2019. A Concise Guide to Market Research. Springer-Verlag GmbH Germany. https://file.zhisci.com/202005/978_3_662_56707_4_cn20200527023547.pdf.