pp <- read_csv("data/paris-paintings.csv", na = c("n/a", "", "NA"))
Pierre-Antoine de Machy, Public Sale at the Hôtel Bullion, Musée Carnavalet, Paris (18th century)
Two paintings very rich in composition, of a beautiful execution, and whose merit is very remarkable, each 17 inches 3 lines high, 23 inches wide; the first, painted on wood, comes from the Cabinet of Madame la Comtesse de Verrue; it represents a departure for the hunt: it shows in the front a child on a white horse, a man who gives the horn to gather the dogs, a falconer and other figures nicely distributed across the width of the painting; two horses drinking from a fountain; on the right in the corner a lovely country house topped by a terrace, on which people are at the table, others who play instruments; trees and fabriques pleasantly enrich the background.
pp %>% filter(name == "R1777-89a") %>% glimpse()
## Rows: 1## Columns: 61## $ name <chr> "R1777-89a"## $ sale <chr> "R1777"## $ lot <chr> "89"## $ position <dbl> 0.3755274## $ dealer <chr> "R"## $ year <dbl> 1777## $ origin_author <chr> "D/FL"## $ origin_cat <chr> "D/FL"## $ school_pntg <chr> "D/FL"## $ diff_origin <dbl> 0## $ logprice <dbl> 8.575462## $ price <dbl> 5300## $ count <dbl> 1## $ subject <chr> "D\x8epart pour la chasse"## $ authorstandard <chr> "Wouwerman, Philips"## $ artistliving <dbl> 0## $ authorstyle <chr> NA## $ author <chr> "Philippe Wouwermans"## $ winningbidder <chr> "Langlier, Jacques for Poullain, Anto…## $ winningbiddertype <chr> "DC"## $ endbuyer <chr> "C"...
...## $ Interm <dbl> 1## $ type_intermed <chr> "D"## $ Height_in <dbl> 17.25## $ Width_in <dbl> 23## $ Surface_Rect <dbl> 396.75## $ Diam_in <dbl> NA## $ Surface_Rnd <dbl> NA## $ Shape <chr> "squ_rect"## $ Surface <dbl> 396.75## $ material <chr> "bois"## $ mat <chr> "b"## $ materialCat <chr> "wood"## $ quantity <dbl> 1## $ nfigures <dbl> 0## $ engraved <dbl> 0## $ original <dbl> 0## $ prevcoll <dbl> 1## $ othartist <dbl> 0## $ paired <dbl> 1## $ figures <dbl> 0## $ finished <dbl> 0...
ggplot(data = pp, aes(x = Height_in)) + geom_histogram(binwidth = 5) + labs(x = "Height, in inches", y = NULL)
ggplot(data = pp, aes(x = Width_in)) + geom_histogram(binwidth = 5) + labs(x = "Width, in inches", y = NULL)
ggplot(data = pp, aes(x = Width_in, y = Height_in)) + geom_point() + geom_smooth(method = "lm") + labs( title = "Height vs. width of paintings", subtitle = "Paris auctions, 1764 - 1780", x = "Width (inches)", y = "Height (inches)" )
## Warning: Removed 258 rows containing non-finite values## (stat_smooth).
## Warning: Removed 258 rows containing missing values (geom_point).
ggplot(data = pp, aes(x = Width_in, y = Height_in)) + geom_point() + geom_smooth(method = "lm", se = FALSE) + labs( title = "Height vs. width of paintings", subtitle = "Paris auctions, 1764 - 1780", x = "Width (inches)", y = "Height (inches)" )
ggplot(data = pp, aes(x = Width_in, y = Height_in)) + geom_point() + geom_smooth(method = "lm", se = FALSE, color = "#8E2C90", linetype = "dashed", size = 3) + labs( title = "Height vs. width of paintings", subtitle = "Paris auctions, 1764 - 1780", x = "Width (inches)", y = "Height (inches)" )
ggplot(data = pp, aes(x = Width_in, y = Height_in)) + geom_point() + geom_smooth(method = "gam", se = FALSE, color = "#8E2C90") + labs( title = "Height vs. width of paintings", subtitle = "Paris auctions, 1764 - 1780", x = "Width (inches)", y = "Height (inches)" )
ggplot(data = pp, aes(x = Width_in, y = Height_in)) + geom_point() + geom_smooth(method = "loess", se = FALSE, color = "#8E2C90") + labs( title = "Height vs. width of paintings", subtitle = "Paris auctions, 1764 - 1780", x = "Width (inches)", y = "Height (inches)" )
ht_wt_fit <- linear_reg() %>% set_engine("lm") %>% fit(Height_in ~ Width_in, data = pp)ht_wt_fit_tidy <- tidy(ht_wt_fit$fit) ht_wt_fit_aug <- augment(ht_wt_fit$fit) %>% mutate(res_cat = ifelse(.resid > 0, TRUE, FALSE))ggplot(data = ht_wt_fit_aug) + geom_point(aes(x = Width_in, y = Height_in, color = res_cat)) + geom_line(aes(x = Width_in, y = .fitted), size = 0.75, color = "#8E2C90") + labs( title = "Height vs. width of paintings", subtitle = "Paris auctions, 1764 - 1780", x = "Width (inches)", y = "Height (inches)" ) + guides(color = "none") + scale_color_manual(values = c("#260b27", "#e6b0e7")) + geom_text(aes(x = 0, y = 150), label = "Positive residual", color = "#e6b0e7", hjust = 0, size = 8) + geom_text(aes(x = 150, y = 25), label = "Negative residual", color = "#260b27", hjust = 0, size = 8)
The plot below displays the relationship between height and width of paintings. The only difference from the previous plots is that it uses a smaller alpha value, making the points somewhat transparent. What feature is apparent in this plot that was not (as) apparent in the previous plots? What might be the reason for this feature?
[1] Source: Wikipedia, Landscape painting
[2] Source: Wikipedia, Portait painting
How, if at all, does the relationship between width and height of paintings vary by whether or not they have any landscape elements?
ggplot(data = pp, aes(x = Width_in, y = Height_in, color = factor(landsALL))) + geom_point(alpha = 0.4) + geom_smooth(method = "lm", se = FALSE) + labs( title = "Height vs. width of paintings, by landscape features", subtitle = "Paris auctions, 1764 - 1780", x = "Width (inches)", y = "Height (inches)", color = "landscape" ) + scale_color_manual(values = c("#E48957", "#071381"))
ggplot(data = pp, aes(x = Width_in, y = Height_in, color = factor(landsALL))) + geom_point(alpha = 0.4) + geom_smooth(method = "lm", se = FALSE, fullrange = TRUE) + labs( title = "Height vs. width of paintings, by landscape features", subtitle = "Paris auctions, 1764 - 1780", x = "Width (inches)", y = "Height (inches)", color = "landscape" ) + scale_color_manual(values = c("#E48957", "#071381"))
is just as important as the model, if not more!
Statistics is the explanation of variation in the context of what remains unexplained.
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |