Publications by Thomas Wood (
Code Lab Session 2--Pivoting data
Reshaping tabular data I can very clearly remember reading Hadley Wickham’s 2007 JSS paper (written while still a grad student!) on reshaping data, and it was a real struggle to understand why we’d want to invest so much time in his approach for eshaping. I initially thought reshaping was a toolkit designed to address an anomaly, where we�...
6699 sym R (7209 sym/20 pcs) 1 img 3 tbl
2023 code lab, lab 1 - dplyr verbs
dplyr’s 5 verbs (and 1 adverb) The principle advantage to the dplyr approach is cognitive–that a huge, potentially limitless set of challenges and statistical tasks… how do I do report means and standard errors by groups? how do I include a new variable with population mean evaluation with each separate respondent evaluation? how do I co...
6624 sym R (5568 sym/19 pcs) 3 img
Answers for Problem Set 1
Question 1 Report the univariate distributions of ideology and partisanship, both as they’re found in the ANES, and as three part scales library(plyr) library(tidyverse) library(magrittr) d1 <- "https://github.com/thomasjwood/ps7160/raw/master/anes_cdf_20211118.rds" %>% url %>% gzcon %>% readRDS d1$pid_3 <- d1$VCF0301 %>% ...
926 sym R (7868 sym/10 pcs) 3 img
PS7160 Lab 2 Fall 2022
Question 1 Q1. Report the relationship between three issues scales (Guaranteed Jobs and Incomes-VCF0809, Government Health Insurance Scale-VCF0806, Government Services-Spending Scale-VCF0839). Which is the most strongly re- lated to presidential vote choice? library(plyr) library(tidyverse) library(magrittr) library(purrrlyr) library(bro...
1805 sym R (6705 sym/6 pcs) 3 img
Document
Question 1 Report the univariate distributions of ideology and partisanship, both as they’re found in the ANES, and as three part scales library(plyr) library(tidyverse) library(magrittr) d1 <- "https://github.com/thomasjwood/ps7160/raw/master/anes_cdf.RDS" %>% url %>% gzcon %>% readRDS %>% as_tibble d1$pid_3 <- d1$VCF0301...
920 sym R (7877 sym/10 pcs) 3 img
PS7160 Lab 2 Answers
Question 1 Q1. Report the relationship between three issues scales (Guaranteed Jobs and Incomes-VCF0809, Government Health Insurance Scale-VCF0806, Government Services-Spending Scale-VCF0839). Which is the most strongly re- lated to presidential vote choice? ## # A tibble: 3 x 2 ## scale .out ## <chr> ...
1788 sym R (5233 sym/5 pcs) 3 img
ps7160 lab exercise on list columns
Last lab During the lab, I was unhelpfully succinct in describing the approach to using list-columns. The withering looks and rueful head shaking will haunt me for years. Anyway, the important thing is–this is hugely beneficial and general means of organizing data and models. So I hope this example motivates the approach. To start with, let’s...
2963 sym R (8437 sym/16 pcs) 1 img
Assignment 3 homework
Question 1 Q1. Take the items from the DFP survey on countermeasures used to mitigate the virus1.Take the national items from the Google mobility data indicating mobility for retail, mobility for visiting a workplace, and mobility for recreation. Aggregate these mobility data with a smoothed average preceding the survey dates of each survey in t...
962 sym R (5005 sym/5 pcs) 2 img
PS4160 Fall 2021 Lab 2
Hi all– Great lab! A wide variety of approaches were observed. I hope your groups’ semi-futile efforts banging away at dlpyr syntax was at least somewhat pedagogically constructive. I promise, we’ll spend more time in a future lab on the relevant verbs of dplyr. The Lab Q1 The first questions asks us about this weird ANES survey device, t...
12246 sym R (4166 sym/11 pcs)
Document
Hi all. A couple of things Wonderful, wonderful attempts at the first lab! This is precisely what I was going for! Working in a group was hopefully a pleasant experience. If at all possible, maybe shuffle group membership before the next lab so that we can have people of different R experience sorted between groups. Our class Slack has been a go...
2634 sym R (8700 sym/17 pcs) 1 img