Publications by Ying Huang
Lab_class session_2
##install packages #install.packages(c("devtools", "tidyverse","bootstrap", "lmtest", "car", "Hmisc", "sandwich", "multcomp", "knitr", "lattice", "lme4", "survey", "pscl", "readstata13", "ctv","ggplot2", "acs", "ggmap", "dplyr", "sjPlot", "survey", "devtools", "muhaz", "coxme","eha", "cmprsk", "knitr","ipumsr","abind", "plotly","plyr"), dependen...
913 sym R (5253 sym/41 pcs)
Lab class session
## Warning: package 'kableExtra' was built under R version 4.0.2 ## Warning: package 'dplyr' was built under R version 4.0.2 Questions Question 1. Create a chunk and calculate the following in one chunk sqrt (16) ## [1] 4 16^0.5 ## [1] 4 4^3 ## [1] 64 Question 2. In the R Markdown file, create a second chunk that contains the following syntax...
1432 sym R (10113 sym/99 pcs)
Homework#3
##load packages to use Instruction: Read the codes and questions carefully. Open a dataset called PRB that’s available under homework folder on blackboard. We would like to know whether total fertility rate (tfr) differs significantly between Africa and the rest of the world. Please type your answers, including my original code in a R-markdown...
2248 sym R (7751 sym/28 pcs) 1 img
Homework#4
##load packages to use Hospital administrators are interested in determining how hospitalization cost (y = cost) is related to length of stay (x = los) in the hospital. The dataset contains the reimbursed hospital costs and associated lengths of stay for a sample of 33 people. Use hospital.txt data to answer the following questions: Question 1....
1684 sym R (5304 sym/37 pcs) 5 img
Finalexam
Part II. R Application (52 points) The dataset for this part of the exam is from Panel Study of Income Dynamics and its 2014 Child Development Supplement Study. Collected and managed by the Survey Research Center of the Institute for Social Research at the University of Michigan, PSID is an ongoing longitudinal survey with...
4601 sym R (14054 sym/43 pcs) 1 img
Survey Statistics using BRFSS data
What is a survey? A systematic method for gathering information from a sample of entities for the purposes of constructing quantitative descriptors of the attributes of the larger population of which the entities are members Questions when identifying a survey data source: What is the target population? What is the sampling frame how do we kno...
11927 sym R (13153 sym/74 pcs) 2 img 6 tbl
Logistic Regression
The codes below prepares the data for proper survey design analysis.Also, some variables were re-coded for the purpose of the research questions #Load data for analysis#sub-setting and Re-codding variables for analysis purposes brfss <- readRDS("brfss_177.rds") # Cleaning the variable names for space, underscore & Uppercase Characters renam<...
1872 sym R (9279 sym/24 pcs) 5 img 2 tbl
Logistic Regression - Other Topics
In this example, we continue the discussion of the logistic regression model from last week. This week we examine model nesting and stratification. We also look at using the logistic regression model for a binary classification model, commonly used in machine learning. #load libraries library(car, quietly = T) library(stargazer, quietly = T) ##...
8537 sym R (22459 sym/95 pcs) 6 img 2 tbl
Example 2 - Logit and Probit Models
Categorical outcomes In the vast majority of situations in your work as demographers, your outcome will either be of a qualitative nature or non-normally distributed, especially if you work with individual level survey data. When we speak of qualitative outcomes, we generally are concerned with the observation of: A particular behavior (marriage...
12367 sym R (9703 sym/48 pcs) 4 img 6 tbl