Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jabranham
Last active August 8, 2016 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jabranham/d1e61e3ff2c9e7aeacdeea0c50d4423d to your computer and use it in GitHub Desktop.
Save jabranham/d1e61e3ff2c9e7aeacdeea0c50d4423d to your computer and use it in GitHub Desktop.
netsupport function in R
netsupport <- function(thedata){
prop_more <- mean(thedata == 1, na.rm = TRUE)
prop_less <- mean(thedata == 3, na.rm = TRUE)
prop_more - prop_less
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment