kuriwaki / ccesmrpprep Goto Github PK
View Code? Open in Web Editor NEWFunctions to Clean and Prepare CCES data for MRP
Home Page: https://www.shirokuriwaki.com/ccesMRPprep/
License: Other
Functions to Clean and Prepare CCES data for MRP
Home Page: https://www.shirokuriwaki.com/ccesMRPprep/
License: Other
Probably same as IQSS/dataverse-client-r#80
> cc16_full <- get_cces_dataverse("2016")
Downloading and reading large dataset, can take about 3-5 minutes to complete.
No encoding supplied: defaulting to UTF-8.
No encoding supplied: defaulting to UTF-8.
Error in df_parse_dta_file(spec, encoding, cols_skip, n_max, skip, name_repair = .name_repair) :
Failed to parse /private/var/folders/58/bg0qcxrs7s7fgf3x_qlj8njw0000gn/T/Rtmptxtxw8/foo67d1310cd2b6: This version of the file format is not supported.
Hi @kuriwaki ,
For the get_acs_cvap()
function, I think the Census variable code you chose are wrong. Citizen Voting Age population should be native or naturalized citizens aged 18 or above. Therefore, it should be the total of 009
, 011
, 020
, 022
for each race category instead of the total of 004
, 006
, 015
, and 017
. Please check them again.
Let me know if I am wrong.
Thank you!
not just CDs.
PRs welcome.
instead of just gender
now that it is on CRAN. Rather than set the github remote.
Also this errors out, even though this function using add_file should have been backwards compatible
library(ccesMRPprep)
cc_y <- get_cces_dataverse(name = "2018")
#> Downloading and reading large dataset, can take about 3-5 minutes to complete.
#> Error in dataset_files(prepend_doi(x), key = key, server = server, ...): Not Found (HTTP 404).
Created on 2021-01-26 by the reprex package (v0.3.0)
acscodes_sex_age_educ is given by 5-way age, but acscodes_sex_age_race is given by 10-way age. The function get_acs_cces should probably get both but rename the relevant one to age
depending on the partition
The emlogit dependency creates a hassle for new Mac users who need to install Rcpp. (basically, they need to go here to reinstall lgfortran). So if only for the convenience of installing and loading packages quickly, we can separate the two.
The synth* methods in R/synth_*.R
also rely on @soichiroy's methods so it would be good to acknowledge that more explicitly.
likely at filter_at(vars(matches(xvar_regex)), ~all_vars(!is.na(.x))) %>% group_by(!!!syms(xvars), add = TRUE)
library(ccesMRPprep)
fm_brm <- yes | responses(n_cell) ~ age + gender + educ + pct_trump + (1|cd)
acs_tab <- get_acs_cces(
varlist = acscodes_age_sex_educ,
varlab_df = acscodes_df,
year = 2018)
#> The 1-year ACS provides data for geographies with populations of 65,000 and greater.
#> Getting data from the 2018 1-year ACS
poststrat <- get_poststrat(acs_tab, cd_info_2018, fm_brm)
#> Joining, by = c("year", "cd")
#> Error: Problem with `filter()` input `..1`.
#> x Base operators are not defined for quosures.
#> Do you need to unquote the quosure?
#>
#> # Bad:
#> myquosure1 & myquosure2
#>
#> # Good:
#> !!myquosure1 & !!myquosure2
#> ℹ Input `..1` is `&...`.
head(poststrat)
#> Error in head(poststrat): object 'poststrat' not found
Created on 2021-01-08 by the reprex package (v0.3.0)
Reported by Arjun Vishwanath
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.