Publications by Jia Liang
ANLY 505 - NYCFlightsDataModel
Summarize Data daily <- flights %>% mutate(date = make_date(year, month, day)) %>% group_by(date) %>% summarize(n = n()) ggplot(daily, aes(date, n)) + geom_line() Investigate Daily-Weekly Pattern daily <- daily %>% mutate(wday = wday(date, label = TRUE)) ggplot(daily, aes(wday,n)) + geom_boxplot() mod = lm(n ~ wday, data = daily, n...
2722 sym R (6235 sym/26 pcs) 17 img
ANLY 505-Diamonds Data Model
Initial Visualization ggplot(diamonds, aes(cut,price)) + geom_boxplot() ggplot(diamonds, aes(color,price)) + geom_boxplot() ggplot(diamonds, aes(clarity,price)) + geom_boxplot() ggplot(diamonds, aes(carat, price)) + geom_hex(bins=50) Subset Data and replot diamonds2 <- diamonds %>% filter(carat <= 2.5) %>% mutate(lprice = log2(price), ...
1723 sym R (5133 sym/19 pcs) 13 img
ANLY 505 Assignment Nested Model
FIND A NESTED MODEL IN LINREG THAT IMPROVES F STATISTIC. set.seed(1001) x1 = sample(1:4, replace = TRUE, 100) x2 = sample(1:4, replace = TRUE, 100) x3 = sample(1:4, replace = TRUE, 100) y = rbinom(100, x1, .3) + rbinom(100, x2, .9) + rpois(100, x3/5) linreg = lm(y ~ x1 + x2 + x3) summary(linreg) ## ## Call: ## lm(formula = y ~ x1 + x2 + x3) ## ...
1045 sym R (4416 sym/10 pcs)
ANLY 505 Simulated Data and Linear Mixed Models
The statistical model: \(y_t = \beta_0 + \beta_1 * (Elevation_s)_t + \beta_2 * Slope_t + (b_s)_t + \epsilon_t\) Where: \(\beta_0\) is the mean response when both Elevation and Slope are 0 \(\beta_1\) is the change in mean response for a 1-unit change in elevation. Elevation is measured at the stand level, so all plots in a stand share a single...
1869 sym R (6033 sym/31 pcs) 2 img
ANLY 505-Data Simulation in R
Directions The objective of this assignment is to introduce you to R and R markdown and to complete some basic data simulation exercises. Please include all code needed to perform the tasks. This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown s...
1349 sym R (2567 sym/10 pcs) 5 img
Intro to STAN Homework
Intro to STAN Homework Part #1 After our Intro to Stan lecture I think it would be valuable to have you go through a similar exercise. Let’s test a second research question. Research question: Is sea ice extent declining in the Southern Hemisphere over time? Is the same pattern happening in the Antarctic as in the Arctic? Fit a Stan model to fi...
918 sym R (6512 sym/19 pcs) 4 img