Giter VIP home page Giter VIP logo

cacommunityburden's Introduction

California Community Burden

The Community Burden of Disease (CBD) is an evolving platform to view and explore detailed disease/condition burden and Social Determinants of Health data on multiple levels of geographic granularity in order to answer and generate questions, both simple and complex.

The code and system are written/structured to useable by States and Counties throughout the United States—with any State or County using their own structured input file of events (e.g. deaths), and the CBD system supplying underlying population data, Social Determinants of Health data, and all the processing, calculations, and tools to generate a range of interactive displays of multiple rate and count measures. The list of disease conditions is based on the Global Burden of Disease system, modified for local public health priorities.

This California State implementation of the CBD, The California Community Burden of Disease and Cost Engine (CCB), currently includes detailed death data and multiple associated measures (e.g. age-adjusted cause-specific Years of Life Lost rates) for 2001 to 2015 at the census tract, community (California Medical Service Study Areas), county, and statewide levels. The CCB also includes a small set of Social Determinants of Health, and describes their correlations with death outcomes, as a pilot for more robust functionality in this area. Other short-term road map plans include the addition of burden of disease and costs (charges) based on California Hospital Discharge data, automated report generation, and more.

Test Sites:

Other Info:

  • A health burden visualization tool; a lens into the relation of place and health disparities
  • Designed for State Health Department programs, Local Health Departments, and community partners; specifically for epidemiologic analysis and systematic scientific insight for allocation of resources, evaluation of interventions, and program planning
  • Clear place-based mortality measure data, to address specific queries;
  • Platform for hypothesis generation and testing;
  • Rich and multi-level data set/system for modeling and predictive analytics.
  • Pilot component of the Calfornia Department of Public Health Ecosystem of Data Sharing, demonstrating automated and integrated data processing, analytics, and visualization.
  • Nimble modular development, with goal to share tools/resources with outside partners (counties and other states).

cacommunityburden's People

Contributors

kangjaspreet avatar mcsamueldatasci avatar shuochenmpp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cacommunityburden's Issues

Added RStudio Wiki instructions

I just poked around, and made a "wiki" entry to use as instructions for our team to get set up for using git with RStudio. Please review and comment if you have time/interest. Thanks.

seeking efficient approach to group_by age adjustment work

Zev (and Nate)-

The first coding approach below works just fine, and the dataframe "countyAA" has exactly what I need. That is: for all county, year, sex, and CAUSE combinations I get the age-adjusted death rate, and associated upper and lower CI, and SE. The only thing I am not grouping by is ageGroup, and this is what drives the whole thing.

BUT, it is clearly inefficient to run the adeadjust.direct function (part of the "epitools" package; modified by me to ageadjust.direct.SAM (to include the SE, and deal with some 0's)) four times. I did this a while ago when I really needed to just get this done, but now am trying to figure out how to do it more efficiently, and have not been successful so far despite a fair bit of effort.

The second approach below partially works, but puts the results in one column in one character string representation of a vector of results--see picture below (the ones with "NAs" are filtered out elsewhere, they have 0 deaths). I could do something to parse out this string, but I bet there is a simpler better way?

Any suggestions would be most appreciated?


countyAA <- ageCounty %>% group_by(county,year,sex,CAUSE) %>%
  summarize(
            aRate   = ageadjust.direct.SAM(count=Ndeaths, pop=pop, rate = NULL, stdpop=US2000POP, conf.level = 0.95)[2]*100000,
            aLCI    = ageadjust.direct.SAM(count=Ndeaths, pop=pop, rate = NULL, stdpop=US2000POP, conf.level = 0.95)[3]*100000,
            aUCI    = ageadjust.direct.SAM(count=Ndeaths, pop=pop, rate = NULL, stdpop=US2000POP, conf.level = 0.95)[4]*100000, 
            aSE     = ageadjust.direct.SAM(count=Ndeaths, pop=pop, rate = NULL, stdpop=US2000POP, conf.level = 0.95)[5]*100000
       ) 
          
countyAAtry2 <- ageCounty %>% group_by(county,year,sex,CAUSE) %>%
  summarize(aMulti = list(unique(
                            round(
                              ageadjust.direct.SAM(count=Ndeaths, pop=pop, rate = NULL, stdpop=US2000POP, conf.level = 0.95)*100000,2)
                            )
                          )
            ) 

capture

SES processor and plot

-decide on beta SES inputs
-break makeSES into standard structure -- SESprocessor and plot files

using sf in tmap

I have migrated all the mapping in the CCB to tmap, and that’s great. I was planning to migrate the “shape files” to “simple features”, but, as far as I can tell, tmap does not support this, with error message “conversion from feature type sfc_GEOMETRY to sp is not supported”. I have done a bit of experimenting as you can see in lines 58-74 of this file where the shapes are brought into the app. No error generated with tmap when I read in the (simple features shape files) with readOGR, but error with reading the same files in with st_read.
Specific questions:

  1. Do you think I should use the “shape files” as simple features objects?
  2. If so, how with tmap?

two conditionalPanel input lists with same inputID

Zev-

How can I do something in the .ui file with conditionalPanel such that the input list varies depending on the condition BUT where the inputID stays the same? For example with issue #32, how could I have "selectInput" "choices" of c("A","B","California","D") for one condition and c("A","B","D") for another condition, BUT where the inputID is myLHJ for both conditions?

remove islands from maps

Zev-
I have tried a number of things to remove ALL the islands from the "shape files" I am working with, and nothing has worked, including the ms_filter_islands() function that I thought surely would. In this demo file, I use ms_filter_islands--few changes to San Francisco, no changes to Los Angeles. Please show me what I am doing wrong or provide another solution? Thanks.

indexing to extract names

Zev-
Is there a more "elegant" or transparent (for other users of my code) way to do the code below, in one case using two vectors, in the other using two columns of a dataframe?

nameVector[valueVector == myValue]

dataFrame[dataFrame[,1]== myValue,2]

branching/forking wiki page

Contributors can't add new wiki pages (only edit current pages), but I think the following wiki page (with your preferred edits) would be helpful regarding branching and forking:

In keeping with standard GITHUB practice, CCB has adopted two procedures to contribute to the projects modular code.

  1. For contributors making changes to one file of the CCB, or contributors who plan to have limited edits applied in a limited amount of time, or contributors working in a collaborative sub-team to edit 1-2 files, forking of the CACommunityBurden repository is suggested. This is primarily to capture the final product in version control. To proceed:
    a. The contributor will make a github account.
    b. From the CCB repository page (https://github.com/mcSamuelDataSci/CACommunityBurden), the contributor will Fork the Repository by selecting the Fork option in the top right corner. After the repository is generated, the contributor will rename the forked repository with their initials (eg. CACommunityBurden-MI) by selecting the Settings tab under the repository names.
    c. The contributor can now edit the desired file in their forked copy of the repository. For general steps to set-up the repository in R see here. Contributors will map to the forked repository url instead of the CCB repository (https://github.com/mcSamuelDataSci/CACommunityBurden). When making edits, contributors will stay on the master branch.
    d. Pull requests can be made and merged in the master branch of the forked repository as necessary.
    e. When all edits are done to the desired 1-2 files, the contributing repository owner will use the "New pull request" button found on the Code tab. The defualt compare changes menu should display the the main repository and the forked repository. Create a pull request to merge repositories on github
    f. The main repository owner (Michael Samuel) will review the suggested changes in R by mapping directly to the contributors URL.
    g. If the changes are accepted, the repository owner will accept the changes on the Github website and the forked repository will need to be deleted by the contributor.

  2. For contributors making changes to more than one file of the CCB, or contributors who plan to have on-going edits applied in an extended amount of time, or contributors working in a collaborative sub-team to edit 3+ files, branching of the CACommunity repository is suggested. This is primarily to capture the on-going editing process in version control. To proceed:
    a. Request to be added as a collaborator. A branch will be created by the main repository owner (Michael Samuel).
    b. The contributor can now edit the desired file in their branched copy of the repository. For general steps to set-up the repository in R see here.
    c. When edits are done to the desired file, the branch owner will use the "New pull request" botton found on the Code tab. Alternatively a pull request can be created in R.
    d. The main repository owner (Michael Samuel) will review the suggested changes in R by reviewing the contributors branch.
    e. If the changes are accepted, the repository owner will accept the changes and assess if the branch needs to be deleted.

If a branch/fork stays open for an extended amount of time, it is up to the contributor to update their branch/fork with the most recent CCB repository files by creating a pull request from the main CCB repository to the branch/fork.

tmap general

Zev-
At your suggestion I have begun migrating the mapping for this project to tmap. In the app, there is currently a "tmap" tab, a "static map" tab, and an "interactive map" tab. Within two weeks I plan to have only the "tmap" tab (and i will be called just "Map" or something), with all of the functionality that is all three tabs currently. At your request, I will start listing issues that are as specific as I can to help with this migration, and for now will be referring to all three of the tabs.
Thanks,
Michael

tmap tm_polygons style error

If on the "Map (tmap)" tab the following are selected:
geographic level: "Census Tract"
Cut-point method: fisher
an error is generated because of missing values, noting that na.rm=TRUE is needed.

Where/how can I set na.rm=TRUE or otherwise systematically address this error? (and not with an is.na(map.1$myMeasure) <- 0 type solution since this creates problems elsewhere).

The key code is at lines 72-75 of the cbd-tmap.R file.

map projection

Somewhat related to #38: I still have not “projected” any of the shape files, and things are working fine. But, you have strongly encouraged projection of all shape files, so I intend to do so. Is this better done when I generate the files here, or when I read them in here?

search files

determine how to search files (including sub-directories) including R files for specific string

Repo needs readme

This is for your practice, I'm adding this issue, I'm creating a branch and adding this file, I'm assigning this issue to me here in GitHub and then I will do a pull request.

In my commit message I write "added readme referencing #6" so it shows up below.

Census tract merge issue

Dave-
for consistency:

  • the county "column" should be named "county", all lower case
  • GEOID should be all upper cases, as you have it
  • the "indicator" variable should use the format as I show on line 30 of the R file, or some other consitent form of your choosing
  • the other variables/columns don't need to be renamed at all, since they are not used elsewhere in the CCB

method to set path

I expect for a lot of users the default path is not the R working directory – i.e. what is getwd() without setwd()?
Currently the user has to set myDrive to the project folder in multiple files. An external local file like .path would be robust to cases where people’s starting directory is a different folder. Another option would be to have an options file like config.txt that would contain all the necessary user-specified options including this path for all scripts.

how to add stop() function to .ui or other proper location

Zev-

What is the proper way to add, and where should I put, something like this?:
if (input$cZoom & input$myLHJ == "CALIFORNIA STATE" ) stop('Illogical Selection')

I have some similar statements (without the input$) WITHIN some functions, and that works fine, but there are some combinations of input values, like those above, that apply to several function/tabs, so would be more efficient to put in one place, rather than in each function.

Could alternatively be accomplished with next issue?

Save User ID and Password

Zev-
I think you were going to send me info about how so save username and password such that R doesn't "ask" each time? related info in the screen shot:
capture

Explore directly labeling lines with ggrepel

library(ggrepel)

NOT like this, but....:

ggplot(mtcars, aes(wt, mpg, label = rownames(mtcars))) +
geom_text_repel() +
geom_point(color = 'red') +
theme_classic(base_size = 16)

Version History

Still looking into how to rollback on an individual file but from what I can tell it's not easy to do in GitHub or R alone. It is easy to do on GitHub desktop and some users have made a strong case for using it. I've asked Jason Vargo if he knows more and he said he can help me Wednesday 08/08/18, so I'll add my R testing in a later post.

Tested on GitHub online

  1. Select the file desired file. Select history. Select the commit you're interested to reverting to.
  2. Select browse files. From here only 1/3 options I explored worked. Clone or download then manual re-upload over the desired repository is the method which worked. I tried generating a pull request from the historic repository but I received a message saying all changes have already been committed. I also tried editing a file directly then updating but the edit option is disabled for historic repositories.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.