Set up environment

#####STEP 0-1: Reset environment #####
rm(list=ls())
knitr::opts_chunk$set(echo = TRUE)
options(repos = structure(c(CRAN = "http://cran.rstudio.com/")))

#####STEP 0-2: Install packages #####
list.of.packages <- c("grf", "metafor", "splitstackshape", "dplyr", "tidyverse", "foreach", "cowplot",
                     "reshape2", "doParallel", "survival", "readstata13", "ggplot2", "rsample", "DiagrammeR",
                     "e1071", "pscl", "pROC", "caret", "ModelMetrics", "MatchIt", "Hmisc", "scales",
                     "lmtest", "sandwich","haven", "rpms", "randomForest", "fabricatr", "gridExtra",
                     "VIM", "mice", "missForest", "lmtest", "ivreg", "kableExtra")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)

lapply(list.of.packages, library, character.only = TRUE)
## Warning: package 'grf' was built under R version 4.3.3
## Warning: package 'metafor' was built under R version 4.3.3
## Warning: package 'metadat' was built under R version 4.3.3
## Warning: package 'numDeriv' was built under R version 4.3.1
## Warning: package 'splitstackshape' was built under R version 4.3.3
## Warning: package 'dplyr' was built under R version 4.3.3
## Warning: package 'tidyverse' was built under R version 4.3.3
## Warning: package 'ggplot2' was built under R version 4.3.3
## Warning: package 'tibble' was built under R version 4.3.3
## Warning: package 'tidyr' was built under R version 4.3.3
## Warning: package 'readr' was built under R version 4.3.3
## Warning: package 'purrr' was built under R version 4.3.3
## Warning: package 'stringr' was built under R version 4.3.3
## Warning: package 'forcats' was built under R version 4.3.3
## Warning: package 'lubridate' was built under R version 4.3.3
## Warning: package 'foreach' was built under R version 4.3.3
## Warning: package 'cowplot' was built under R version 4.3.3
## Warning: package 'reshape2' was built under R version 4.3.3
## Warning: package 'doParallel' was built under R version 4.3.3
## Warning: package 'iterators' was built under R version 4.3.3
## Warning: package 'readstata13' was built under R version 4.3.3
## Warning: package 'rsample' was built under R version 4.3.3
## Warning: package 'DiagrammeR' was built under R version 4.3.3
## Warning: package 'e1071' was built under R version 4.3.3
## Warning: package 'pscl' was built under R version 4.3.3
## Warning: package 'pROC' was built under R version 4.3.3
## Warning: package 'caret' was built under R version 4.3.3
## Warning: package 'ModelMetrics' was built under R version 4.3.3
## Warning: package 'MatchIt' was built under R version 4.3.3
## Warning: package 'Hmisc' was built under R version 4.3.3
## Warning: package 'scales' was built under R version 4.3.3
## Warning: package 'lmtest' was built under R version 4.3.3
## Warning: package 'zoo' was built under R version 4.3.3
## Warning: package 'sandwich' was built under R version 4.3.3
## Warning: package 'haven' was built under R version 4.3.3
## Warning: package 'rpms' was built under R version 4.3.3
## Warning: package 'randomForest' was built under R version 4.3.3
## Warning: package 'fabricatr' was built under R version 4.3.3
## Warning: package 'gridExtra' was built under R version 4.3.3
## Warning: package 'VIM' was built under R version 4.3.3
## Warning: package 'colorspace' was built under R version 4.3.3
## Warning: package 'mice' was built under R version 4.3.3
## Warning in check_dep_version(): ABI version mismatch: 
## lme4 was built with Matrix ABI version 1
## Current Matrix ABI version is 0
## Please re-install lme4 from source or restore original 'Matrix' package
## Warning: package 'missForest' was built under R version 4.3.3
## Warning: package 'ivreg' was built under R version 4.3.3
## Warning: package 'kableExtra' was built under R version 4.3.3
print(paste("Version of grf package:", packageVersion("grf")))

#####STEP 0-3: Basic information #####
Sys.time()
# Get detailed R session and system information
session_info <- sessionInfo()
system_info <- Sys.info()
# Combine the output
list(session_info = session_info, system_info = system_info)

Set non-run-specific parameters

#####STEP 0-4: Set non-run-specific parameters #####
seedset <- 777
numthreadsset <- min(6, parallel::detectCores()) 
if (numthreadsset!= 6) {
  print("the results of grf vary by num.thread (publication paper used num.thread=6)")
} 

cat("number of threads (affects grf results):", numthreadsset,"\n")
## number of threads (affects grf results): 6
# Set printing options
options(digits = 4)

Set run-specific parameters

#####STEP 0-5: Set run-specific parameters #####
published_paper_run <- 0 # ANALYST FORM
if (published_paper_run == 1) {
  print("save output into PP_Full_Analysis/Saved_tables_figures/As_published/ folder")
  warning("Changing this setting to 1 overwrites the input files required for replicating on different platforms.")
} else {
  print("save output into PP_Full_Analysis/Saved_tables_figures/Testing/ folder")
}
## [1] "save output into PP_Full_Analysis/Saved_tables_figures/Testing/ folder"
use_auxiliary_file <- 0 # ANALYST FORM
if (use_auxiliary_file == 1) {
  print("outcome and ranking variable pairs are coming from auxiliary file.")
} else {
  print("please specify outcome and ranking variable pairs in this file")
}
## [1] "please specify outcome and ranking variable pairs in this file"
# Each outcome and ranking var needs to be identified by outcome_cwX_lambda_X, where the first X is the Cw value and the second X is the lambda value. If you don't want either modification, use 0. 
if (use_auxiliary_file == 1) {
  #read in pairs from file into dataframe as specified_pairs
  # cate_outcome_rankvar_pairs <- specified_pairs$cate_pairs
  # clate_outcome_rankvar_pairs <- specified_pairs$clate_pairs
} else {
  cate_outcome_rankvar_pairs <- list( # ANALYST FORM
    list("sim_sbp_neg_alpha_5_presentation_cw0_lambda_0", "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"),
    list("sim_debt_neg_alpha_5_presentation_cw0_lambda_0", "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"), 
    list("sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0", "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"),
    list("sim_sbp_neg_alpha_5_presentation_cw0_lambda_0", "ohp_all_ever_inperson_cw0_lambda_0"),
    list("sim_debt_neg_alpha_5_presentation_cw0_lambda_0", "ohp_all_ever_inperson_cw0_lambda_0"),
    list("sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0", "ohp_all_ever_inperson_cw0_lambda_0"),
    
    list("sim_sbp_neg_alpha_5_presentation_cw0_lambda_0", "sim_sbp_neg_alpha_5_presentation_cw0_lambda_1"),
    list("sim_debt_neg_alpha_5_presentation_cw0_lambda_0", "sim_debt_neg_alpha_5_presentation_cw0_lambda_1"),
    list("sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0", "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_1"),
    
    list("sim_sbp_neg_alpha_5_presentation_cw0_lambda_0", "sim_sbp_neg_alpha_5_presentation_cw0_lambda_2"),
    list("sim_debt_neg_alpha_5_presentation_cw0_lambda_0", "sim_debt_neg_alpha_5_presentation_cw0_lambda_2"),
    list("sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0", "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_2"),
    
    list("sim_sbp_neg_alpha_5_presentation_cw0_lambda_0", "sim_sbp_neg_alpha_5_presentation_cw0_lambda_3"),
    list("sim_debt_neg_alpha_5_presentation_cw0_lambda_0", "sim_debt_neg_alpha_5_presentation_cw0_lambda_3"),
    list("sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0", "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_3"),
    
    list("sim_sbp_neg_alpha_5_presentation_cw0_lambda_0", "sim_sbp_neg_alpha_5_presentation_cw0_lambda_4"),
    list("sim_debt_neg_alpha_5_presentation_cw0_lambda_0", "sim_debt_neg_alpha_5_presentation_cw0_lambda_4"),
    list("sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0", "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_4")
  )
  clate_outcome_rankvar_pairs <- list( # ANALYST FORM
    list("sim_sbp_neg_alpha_5_presentation_cw0_lambda_0", "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"),
    list("sim_debt_neg_alpha_5_presentation_cw0_lambda_0", "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"), 
    list("sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0", "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"),
    
    list("sim_sbp_neg_alpha_5_presentation_cw0_lambda_0", "sim_sbp_neg_alpha_5_presentation_cw0_lambda_1"),
    list("sim_debt_neg_alpha_5_presentation_cw0_lambda_0", "sim_debt_neg_alpha_5_presentation_cw0_lambda_1"),
    list("sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0", "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_1"), 
    
    list("sim_sbp_neg_alpha_5_presentation_cw0_lambda_0", "sim_sbp_neg_alpha_5_presentation_cw0_lambda_2"),
    list("sim_debt_neg_alpha_5_presentation_cw0_lambda_0", "sim_debt_neg_alpha_5_presentation_cw0_lambda_2"),
    list("sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0", "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_2"),
    
    list("sim_sbp_neg_alpha_5_presentation_cw0_lambda_0", "sim_sbp_neg_alpha_5_presentation_cw0_lambda_3"),
    list("sim_debt_neg_alpha_5_presentation_cw0_lambda_0", "sim_debt_neg_alpha_5_presentation_cw0_lambda_3"),
    list("sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0", "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_3"),
    
    list("sim_sbp_neg_alpha_5_presentation_cw0_lambda_0", "sim_sbp_neg_alpha_5_presentation_cw0_lambda_4"),
    list("sim_debt_neg_alpha_5_presentation_cw0_lambda_0", "sim_debt_neg_alpha_5_presentation_cw0_lambda_4"),
    list("sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0", "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_4")
  )
}

# Get first item from each list in cate_outcome_rankvar_pairs
outcomes_list <- sapply(cate_outcome_rankvar_pairs, `[[`, 1)

covariates_list <- c("X.gender_inp", "X.age_inp") # ANALYST FORM

cw_run_name <- "med" # ANALYST FORM
cw_grid <- 5 # ANALYST FORM

# Define cw_name
cw_name <- paste0("cw_", cw_run_name, "_", cw_grid)

Set file paths

#####STEP 0-6: Set file paths #####
# Set the processed path based on published_paper_run
processedpath <- if (published_paper_run == 1) {
  paste0("PP_Full_Analysis/Intermediate_data/As_published/empirical/", cw_name)
} else {
  paste0("PP_Full_Analysis/Intermediate_data/Testing/empirical/", cw_name)
}

# Set the results_dir based on published_paper_run and cw_name
results_dir <- if (published_paper_run == 1) {
  paste0("PP_Full_Analysis/Saved_tables_figures/As_published/", cw_name)
} else {
  paste0("PP_Full_Analysis/Saved_tables_figures/Testing/", cw_name)
}

# If results directory does not exist, create it
if (!dir.exists(results_dir)) {
  dir.create(results_dir, recursive = TRUE)
}

# Print processed path and results directory
print(paste("Processed path:", processedpath))
## [1] "Processed path: PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5"
print(paste("Results directory:", results_dir))
## [1] "Results directory: PP_Full_Analysis/Saved_tables_figures/Testing/cw_med_5"

Create functions

Create CLATE quintile function

#----------------------------------------
# 1. DEFINE QUINTILE PLOT FUNCTIONS for CLATE
#----------------------------------------
create_quintile_clate_plot <- function(outcome_var, ranking_var, cdf_dataframe) {
  print("#####Running clate function.#####")
    
# Initialize vectors to store results for cumulative analysis
rnk <- numeric()        # Will store quintile labels (Q1-Q5)
estimate <- numeric()   # Will store CLATE estimates
lowCI <- numeric()      # Will store lower confidence interval bounds
highCI <- numeric()     # Will store upper confidence interval bounds
n_obs <- numeric()      # Will store number of observations

# Initialize list to store regression results
regression_results <- list()

# Loop through quintiles
  for (i in 1:5) {
    # Subset data for current quintile
    data_subset <- cdf_dataframe[cdf_dataframe$clate_rankings_selected == i, ]
    
    # Check if household size has multiple levels
    numhh_levels <- length(unique(na.omit(data_subset$numhh_list)))
    
    # Create appropriate IV regression formula
    if (numhh_levels > 1) {
        formula_str <- paste("Y ~ clate_W + as.factor(numhh_list) +", paste(covariates_list, collapse = " + "), "|",
                            "Z + as.factor(numhh_list) +", paste(covariates_list, collapse = " + "))
    } else {
        formula_str <- paste("Y ~ clate_W +", paste(covariates_list, collapse = " + "), "|",
                            "Z +", paste(covariates_list, collapse = " + "))
    }  
  print(formula_str)

  # Run instrumental variables regression with error handling
  tryCatch({
      model <- ivreg(as.formula(formula_str),
                    weights = weights,
                    data = data_subset)
      print(summary(model))
      
      # Store full regression results
      regression_results[[paste0("Q", i)]] <- summary(model)
    
      # Extract and store results
      coef_summary <- summary(model)$coefficients
      
      rnk[i] <- paste0("Q", i)
      estimate[i] <- coef_summary["clate_W", "Estimate"]
      lowCI[i] <- coef_summary["clate_W", "Estimate"] - 1.96 * coef_summary["clate_W", "Std. Error"]
      highCI[i] <- coef_summary["clate_W", "Estimate"] + 1.96 * coef_summary["clate_W", "Std. Error"]
      n_obs[i] <- nrow(data_subset)
  }, error = function(e) {
      rnk[current_index] <- paste0(i, "th")
      estimate[current_index] <- NA
      lowCI[current_index] <- NA
      highCI[current_index] <- NA
      n_obs[current_index] <- nrow(data_subset)
  })
}
  
  print("rnk")
  print(rnk)
  
  # Create plot data frame
  plot_data <- data.frame(
    Quintile = factor(rnk, 
                     levels = paste0("Q", 1:5)),  # Changed to Q1-Q5
    Estimate = estimate,
    LowCI = lowCI,
    HighCI = highCI,
    N = n_obs
  )
  
  # Save plot data to csv
  write.csv(plot_data, file.path(results_dir, paste0("clate_quintile_plot_data_", outcome_var, "_", ranking_var, ".csv")))
  
  # Create plot title with direction indication
  title_text <- sprintf("CLATE of %s, ranked by %s", outcome_var, ranking_var)
  
  # Get global min and max values for consistent y-axis scaling
  y_min <- min(c(plot_data$LowCI, plot_data$HighCI), na.rm = TRUE)
  y_max <- max(c(plot_data$LowCI, plot_data$HighCI), na.rm = TRUE)
  
  # Add some padding to the y-axis limits
  y_range <- y_max - y_min
  y_min <- y_min - 0.1 * y_range
  y_max <- y_max + 0.1 * y_range
  
  xaxislabel <- paste0("Quintile Groups ranked by ", ranking_var)
    print(xaxislabel)
  
  # Create ggplot visualization
  p <- ggplot(plot_data, aes(x = Quintile, y = Estimate)) +
      geom_point(position=position_dodge(0.2), size=3) +
      geom_errorbar(aes(ymin = LowCI, ymax = HighCI),
                    width=.2, position=position_dodge(0.2)) +
      geom_hline(yintercept = 0, linetype = "dashed", color = "red") +
      theme_minimal() +
      labs(title = title_text,
            y = "CLATE: Change by Medicaid",
            x = xaxislabel) +
      theme(legend.position = "bottom",
            axis.text.x = element_text(angle = 45, hjust = 1),
            plot.title = element_text(hjust = 0.5)) +
      suppressMessages(coord_cartesian(ylim = c(y_min, y_max)))  # Suppress coordinate system message
  
  # Save plots
  png_file_name <- file.path(results_dir, paste0("clate_quintile_plot_", outcome_var, "_", ranking_var, ".png"))
  ggsave(png_file_name, plot = p, width = 10, height = 6, dpi = 300)

  pdf_file_name <- file.path(results_dir, paste0("clate_quintile_plot_", outcome_var, "_", ranking_var, ".pdf"))
  ggsave(pdf_file_name, plot = p, width = 10, height = 6)
}

Create CATE cdf function

#----------------------------------------
# 2. DEFINE QUINTILE PLOT FUNCTIONS for CATE
#---------------------------------------- 
create_quintile_cate_plot <- function(outcome_var, ranking_var, cdf_dataframe) {
  print("#####Running cate function.#####")

  # Initialize vectors to store results for cumulative analysis
  rnk <- numeric()        # Will store percentile labels
  estimate <- numeric()   # Will store estimates
  lowCI <- numeric()      # Will store lower confidence interval bounds
  highCI <- numeric()     # Will store upper confidence interval bounds
  n_obs <- numeric()      # Will store number of observations
  
  # Initialize list to store regression results
  regression_results <- list()

  # Loop through quintiles     
  for (i in 1:5) {
    # Subset data for current quintile
    subset_data <- cdf_dataframe[cdf_dataframe$cate_rankings_selected == i,]
        
    # Check if household size has multiple levels
    numhh_levels <- length(unique(na.omit(subset_data$numhh_list)))
        
    if (numhh_levels > 1) {
      # Run linear regression with household size as factor if multiple levels exist
      model_subset <- lm(as.formula(paste("Y ~ cate_W + as.factor(numhh_list) +", paste(covariates_list, collapse = " + "))),
                      weights = weights,
                      data = subset_data)
    } else {
        # Run linear regression without household size if only one level
        model_subset <- lm(as.formula(paste("Y ~ cate_W +", paste(covariates_list, collapse = " + "))),
                      weights = weights,
                      data = subset_data)
        }
      
      # Store full regression results
      regression_results[[paste0("Q", i)]] <- summary(model_subset)
      
      # Extract coefficient summary from the model
      coef_summary <- summary(model_subset)$coefficients
      
      # Store results for this quintile
      rnk[i] <- paste0("Q", i)
      estimate[i] <- coef_summary["cate_W", "Estimate"]
      lowCI[i] <- coef_summary["cate_W", "Estimate"] -
                1.96 * coef_summary["cate_W", "Std. Error"]
      highCI[i] <- coef_summary["cate_W", "Estimate"] +
                1.96 * coef_summary["cate_W", "Std. Error"]
      n_obs[i] <- nrow(subset_data)
  }    

  # Combine results into a data frame for plotting
  plot_data <- data.frame(
      Quintile = factor(rnk, levels = paste0("Q", 1:5)),
      Estimate = estimate,
      LowCI = lowCI,
      HighCI = highCI,
      N = n_obs
  )

  # Save plot data to csv
  write.csv(plot_data, file.path(results_dir, paste0("cate_quintile_plot_", outcome_var, "_", ranking_var, ".csv")))
  
  # Create plot title using readable names
  title_text <- sprintf("%s CATE, ranked by %s",
                        outcome_var, ranking_var)
  
  # Create ggplot visualization with increased sizes
  p <- ggplot(plot_data, aes(x = Quintile, y = Estimate)) +
      geom_point(size = 4.5) +  # Increased from 3
      geom_errorbar(aes(ymin = LowCI, ymax = HighCI), width = 0.3) +  # Increased from 0.2
      theme_minimal(base_size = 15) +  # Base font size increased by 1.5x
      labs(title = title_text,
            y = paste(outcome_var, "CATE"),
            x = "Quintile") +
      theme(
          plot.title = element_text(size = 18),  # Title size increased
          axis.title = element_text(size = 16),  # Axis title size increased
          axis.text = element_text(size = 14),   # Axis text size increased
          legend.position = "bottom",
          legend.text = element_text(size = 14), # Legend text size increased
          plot.margin = unit(c(1, 1, 1, 1), "cm")  # Margins in centimeters
      )

  # Save plots
  png_file_name <- file.path(results_dir, paste0("cate_quintile_plot_", outcome_var, "_", ranking_var, ".png"))
  ggsave(png_file_name, plot = p, width = 10, height = 6, dpi = 300)

  pdf_file_name <- file.path(results_dir, paste0("cate_quintile_plot_", outcome_var, "_", ranking_var, ".pdf"))
  ggsave(pdf_file_name, plot = p, width = 10, height = 6)

  
  print(p)
}

Create combined increasing and decreasing plot function

#----------------------------------------
# 2. DEFINE TOP AND BOTTOM PLOTS
#----------------------------------------
create_quintile_outcome_plots <- function(outcome, ranking_v, type) {
  # Create both plots
  print("Starting plots for outcome and ranking variable:")
  print(outcome)
  print(ranking_v)
  
  result <- read_treatment_effect_datasets(outcome, ranking_v)

  if (type == "clate") {
     print(type)
    create_quintile_clate_plot(outcome, ranking_v, result)
  }
  else if (type == "cate") {
      print(type)
    create_quintile_cate_plot(outcome, ranking_v, result)
  }
}

Create read data function

#----------------------------------------
# 3. DEFINE FUNCTIONS TO READ RELEVANT DATA
#----------------------------------------
# need clarity on how we want to define outcomes and ranking variables
read_treatment_effect_datasets <- function(outcome, ranking_v) {
  print("#####Creating dataframe.#####")
  
    base_filename <- "/cate_clate_results_"
    

  if (outcome == ranking_v) { ## Only need to open one dataframe, though we still re-append 2 existing columns as "cate_rankings_selected' and "clate_rankings_selected"
    
    # Extract everything up to the final hyphen, so from sbp_cw0_lambda_0, we get sbp_cw0
    input_base <- sub("_lambda_.*", "", outcome)
    

    # Extract the number after the final hyphen (lambda) and store it in input_lambda, so from sbp_cw0_lambda_0, we get 0
    ranking_lambda <- sub(".*lambda_", "", ranking_v)
    cate_lambda_column <- paste0("cate_lambda_", ranking_lambda, "_ranking_5")
    print(cate_lambda_column)

    # Construct the filename by appending to the base file name
    filename <- paste0(processedpath, base_filename, input_base, ".csv")
    
    # Print the filename (to check)
    print(filename)
    
    if (file.exists(filename)) {
      # Read the CSV file into a dataframe
      
      tryCatch({
        outcome_df <- read.csv(filename)
      }, error = function(e) {
      message("Error: ", e)
      })
      outcome_df <- read.csv(filename)

      print("outcome_df:")
      glimpse(outcome_df)
      
      # Add OHP-specific logic
      if(input_base == "ohp_all_ever_inperson_cw0") {
        print("OHP analysis detected - excluding CLATE rankings")
        selected_ranking_df <- outcome_df[, c("person_id", cate_lambda_column)]
        # Rename columns in selected_ranking_df
        colnames(selected_ranking_df)[2] <- "cate_rankings_selected"
      } else {
        print("Non-OHP analysis - including CLATE rankings")
        selected_ranking_df <- outcome_df[, c("person_id", cate_lambda_column, "clate_ranking_5")]
        # Rename columns in selected_ranking_df
        colnames(selected_ranking_df)[2] <- "cate_rankings_selected"
        colnames(selected_ranking_df)[3] <- "clate_rankings_selected"
      }
    } else {
      cat(sprintf("File does not exist: %s", filename))
    }
  } else {
    
    # Read in csv for outcome
    outcome_input_base <- sub("_lambda_.*", "", outcome)
    outcome_filename <- paste0(processedpath, base_filename, outcome_input_base, ".csv")
    print("outcome filename")
    print(outcome_filename)
    outcome_df <- read.csv(outcome_filename)
    glimpse(outcome_df)

    # Read in csv for ranking variable
    ranking_input_base <- sub("_lambda_.*", "", ranking_v)
    ranking_lambda <- sub(".*lambda_", "", ranking_v)
    ranking_filename <- paste0(processedpath, base_filename, ranking_input_base, ".csv")
    print("ranking filename")
    print(ranking_filename)
    ranking_df <- read.csv(ranking_filename)
    glimpse(ranking_df)
    
    # Dynamically construct the ranking column name for the ranking dataframe
    cate_lambda_column <- paste0("cate_lambda_", ranking_lambda, "_ranking_5")
    
    # Add OHP-specific logic for different outcome/ranking case
    if(outcome_input_base == "ohp_all_ever_inperson_cw0" || ranking_input_base == "ohp_all_ever_inperson_cw0") {
      print("OHP analysis detected - excluding CLATE rankings")
      selected_ranking_df <- ranking_df[, c("person_id", cate_lambda_column)]
      # Rename columns in selected_ranking_df
      colnames(selected_ranking_df)[2] <- "cate_rankings_selected"
    } else {
      print("Non-OHP analysis - including CLATE rankings")
      selected_ranking_df <- ranking_df[, c("person_id", cate_lambda_column, cate_lambda_column)]
      # Rename columns in selected_ranking_df
      colnames(selected_ranking_df)[2] <- "cate_rankings_selected"
      colnames(selected_ranking_df)[3] <- "clate_rankings_selected"
    }
  }

    # Print dimensions of selected_ranking_df
    print(paste("Dimensions of selected_ranking_df:", dim(selected_ranking_df)))

    # Print dimensions of outcome_df
    print(paste("Dimensions of outcome_df:", dim(outcome_df)))

    # Merge selected_ranking_df with outcome_df on person_id
    cdf_data <- merge(selected_ranking_df, outcome_df, by = "person_id")

    # Print dimensions of the resulting merged data frame
    print(paste("Dimensions of cdf_data:", dim(cdf_data)))

    # Optionally, view the first few rows of the merged data frame
    print(head(cdf_data))
    
    return (cdf_data)
}

Loop over outcome and ranking variable pairs

#----------------------------------------
# 4. MAIN LOOP
#----------------------------------------
# Iterate over pairs for cate treatment effect
for (i in seq_along(cate_outcome_rankvar_pairs)) {
    outcome <- cate_outcome_rankvar_pairs[[i]][[1]]         
    ranking_variable <- cate_outcome_rankvar_pairs[[i]][[2]]
    
    # Create plot 
    create_quintile_outcome_plots(outcome, ranking_variable, "cate")
}
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "#####Creating dataframe.#####"
## [1] "cate_lambda_0_ranking_5"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## [1] "outcome_df:"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12167"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12167" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12167" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      3                       2            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      1                       1            1
## 5        18                      5                       5            1
## 6        23                      1                       2            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed       Y clate_W Z weights folds
## 1                  0                     0 -144.00       0 1  1.1504     8
## 2                  0                     0 -134.00       0 0  0.8975     1
## 3               1888                  1888  -84.61       1 0  1.0000    10
## 4                  0                     0 -168.00       0 0  1.2126     3
## 5               1715                  1006 -160.39       0 0  1.0000    10
## 6                  0                     0  -98.00       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W     cate cate_se
## 1  3.5659    4.664               2                8      1  1.88542   1.713
## 2  3.3977    2.461               2                8      0  0.47401   1.194
## 3 86.5757    4.745               5               20      0 28.31469   3.951
## 4  0.8981    4.609               1                3      0 -0.08733   2.145
## 5 75.1033    5.278               5               18      0 20.69142   2.405
## 6  3.2103    3.311               2                8      1  0.09818   1.095
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              3              12       1.88542                       3
## 2              2               6       0.47401                       2
## 3              5              20      28.31469                       5
## 4              1               3      -0.08733                       1
## 5              5              18      20.69142                       5
## 6              1               4       0.09818                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       12        1.4572                       3
## 2                        6        0.1755                       2
## 3                       20       27.3270                       5
## 4                        3       -0.6235                       1
## 5                       18       20.0903                       5
## 6                        4       -0.1755                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       12        1.0289                       3
## 2                        6       -0.1231                       2
## 3                       20       26.3393                       5
## 4                        2       -1.1597                       1
## 5                       18       19.4891                       5
## 6                        4       -0.4493                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       11        0.6007                       3
## 2                        6       -0.4216                       2
## 3                       20       25.3516                       5
## 4                        2       -1.6958                       1
## 5                       18       18.8880                       5
## 6                        4       -0.7230                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       11        0.1724                       3
## 2                        6       -0.7201                       2
## 3                       20       24.3639                       5
## 4                        1       -2.2320                       1
## 5                       18       18.2868                       5
## 6                        4       -0.9967                       1
##   cate_lambda_4_ranking_20
## 1                       11
## 2                        6
## 3                       20
## 4                        1
## 5                       18
## 6                        4
## [1] "cate"
## [1] "#####Running cate function.#####"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "#####Creating dataframe.#####"
## [1] "cate_lambda_0_ranking_5"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## [1] "outcome_df:"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12094"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12094" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12094" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      5                       5            1
## 2         8                      1                       1            2
## 3        16                      1                       1            2
## 4        17                      5                       5            1
## 5        18                      2                       2            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed Y clate_W Z weights folds   clate
## 1                  0                     0 1       0 1  1.1504     8 0.39883
## 2                  0                     0 0       0 0  0.8975     1 0.19916
## 3               1888                  1888 1       1 0  1.0000    10 0.18745
## 4                  0                     0 0       0 0  1.2126     3 0.41306
## 5               1715                  1006 1       0 0  1.0000    10 0.23865
## 6                  0                     0 0       1 1  1.0033     9 0.02548
##   clate_se clate_ranking_5 clate_ranking_20 cate_W    cate  cate_se
## 1  0.16302               5               18      1 0.09723 0.009730
## 2  0.10261               1                4      0 0.05205 0.024135
## 3  0.11559               1                3      0 0.04867 0.027492
## 4  0.05780               5               19      0 0.09769 0.019527
## 5  0.07205               2                6      0 0.07025 0.018605
## 6  0.22824               1                1      1 0.02229 0.009796
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              5              19       0.09723                       5
## 2              1               4       0.05205                       1
## 3              1               3       0.04867                       1
## 4              5              19       0.09769                       5
## 5              2               7       0.07025                       2
## 6              1               1       0.02229                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       19       0.09480                       5
## 2                        4       0.04601                       1
## 3                        3       0.04180                       1
## 4                       19       0.09281                       5
## 5                        7       0.06560                       2
## 6                        1       0.01984                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       19       0.09237                       5
## 2                        4       0.03998                       1
## 3                        3       0.03492                       1
## 4                       19       0.08793                       5
## 5                        7       0.06095                       2
## 6                        1       0.01739                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       19       0.08994                       5
## 2                        4       0.03395                       1
## 3                        3       0.02805                       1
## 4                       19       0.08304                       5
## 5                        8       0.05629                       2
## 6                        1       0.01494                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       20       0.08750                       5
## 2                        4       0.02791                       1
## 3                        3       0.02118                       1
## 4                       18       0.07816                       5
## 5                        8       0.05164                       2
## 6                        1       0.01249                       1
##   cate_lambda_4_ranking_20
## 1                       20
## 2                        3
## 3                        2
## 4                       18
## 5                        8
## 6                        1
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "#####Creating dataframe.#####"
## [1] "cate_lambda_0_ranking_5"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## [1] "outcome_df:"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12151"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12151" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12151" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      1                       1            1
## 2         8                      2                       1            2
## 3        16                      5                       5            2
## 4        17                      2                       2            1
## 5        18                      5                       5            1
## 6        23                      3                       3            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed      Y clate_W Z weights folds
## 1                  0                     0 -48.33       0 1  1.1504     8
## 2                  0                     0 -51.33       0 0  0.8975     1
## 3               1888                  1888  -5.64       1 0  1.0000    10
## 4                  0                     0 -51.33       0 0  1.2126     3
## 5               1715                  1006 -61.02       0 0  1.0000    10
## 6                  0                     0 -31.08       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W    cate cate_se
## 1 -3.2872    3.897               1                2      1 -1.5142  1.4284
## 2 -2.8577    1.750               1                2      0 -0.6430  0.8423
## 3 65.0260    1.974               5               18      0 21.0091  4.0054
## 4  0.3029    3.198               2                8      0 -0.1304  1.1931
## 5 58.0718    3.386               5               17      0 17.8280  3.7253
## 6  1.6028    5.641               3               10      1  0.5509  0.8306
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              1               2       -1.5142                       1
## 2              2               5       -0.6430                       2
## 3              5              19       21.0091                       5
## 4              2               7       -0.1304                       2
## 5              5              18       17.8280                       5
## 6              3              11        0.5509                       3
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                        2       -1.8713                       1
## 2                        5       -0.8536                       2
## 3                       19       20.0077                       5
## 4                        7       -0.4286                       2
## 5                       18       16.8966                       5
## 6                       11        0.3433                       3
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                        2       -2.2284                       1
## 2                        5       -1.0642                       2
## 3                       19       19.0064                       5
## 4                        7       -0.7269                       2
## 5                       18       15.9653                       5
## 6                       11        0.1356                       3
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                        1        -2.585                       1
## 2                        5        -1.275                       2
## 3                       19        18.005                       5
## 4                        7        -1.025                       2
## 5                       17        15.034                       5
## 6                       12        -0.072                       3
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                        1       -2.9426                       1
## 2                        6       -1.4853                       2
## 3                       19       17.0037                       5
## 4                        7       -1.3234                       2
## 5                       17       14.1027                       5
## 6                       12       -0.2796                       3
##   cate_lambda_4_ranking_20
## 1                        1
## 2                        6
## 3                       19
## 4                        7
## 5                       17
## 6                       12
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "ohp_all_ever_inperson_cw0_lambda_0"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_ohp_all_ever_inperson_cw0.csv"
## Rows: 12,208
## Columns: 45
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ cate                     <dbl> 0.2242, 0.2154, 0.2668, 0.2787, 0.2692, 0.176…
## $ cate_se                  <dbl> 0.013531, 0.013647, 0.017988, 0.012490, 0.025…
## $ cate_ranking_5           <int> 2, 2, 4, 5, 4, 1, 1, 3, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_ranking_20          <int> 6, 5, 15, 18, 16, 1, 2, 12, 14, 13, 10, 15, 1…
## $ cate_lambda_0            <dbl> 0.2242, 0.2154, 0.2668, 0.2787, 0.2692, 0.176…
## $ cate_lambda_0_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 3, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 6, 5, 15, 18, 16, 1, 2, 12, 14, 13, 10, 14, 1…
## $ cate_lambda_1            <dbl> 0.2209, 0.2120, 0.2623, 0.2756, 0.2627, 0.172…
## $ cate_lambda_1_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 3, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 6, 5, 15, 19, 15, 1, 2, 12, 14, 14, 11, 15, 1…
## $ cate_lambda_2            <dbl> 0.2175, 0.2086, 0.2578, 0.2725, 0.2563, 0.167…
## $ cate_lambda_2_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 3, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 6, 5, 15, 19, 15, 1, 2, 12, 14, 14, 11, 15, 1…
## $ cate_lambda_3            <dbl> 0.2141, 0.2052, 0.2533, 0.2693, 0.2498, 0.163…
## $ cate_lambda_3_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 4, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 7, 5, 16, 19, 15, 1, 2, 13, 15, 15, 12, 15, 1…
## $ cate_lambda_4            <dbl> 0.2107, 0.2017, 0.2488, 0.2662, 0.2434, 0.158…
## $ cate_lambda_4_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 4, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 7, 6, 16, 19, 15, 1, 2, 13, 15, 15, 12, 15, 1…
## [1] "OHP analysis detected - excluding CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12208"
## [2] "Dimensions of selected_ranking_df: 2"    
## [1] "Dimensions of outcome_df: 12167" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12167" "Dimensions of cdf_data: 52"   
##   person_id cate_rankings_selected X.numhh_list X.gender_inp X.age_inp
## 1         5                      2            1            1        60
## 2         8                      2            2            0        41
## 3        16                      4            2            1        39
## 4        17                      5            1            0        52
## 5        18                      4            1            0        51
## 6        23                      1            2            1        32
##   X.hispanic_inp X.race_white_inp X.race_black_inp X.race_nwother_inp
## 1              1                0                0                  0
## 2              0                1                0                  0
## 3              0                1                0                  0
## 4              0                1                0                  0
## 5              0                0                1                  0
## 6              1                0                0                  0
##   X.ast_dx_pre_lottery X.dia_dx_pre_lottery X.hbp_dx_pre_lottery
## 1                    0                    0                    0
## 2                    1                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    1
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chl_dx_pre_lottery X.ami_dx_pre_lottery X.chf_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.emp_dx_pre_lottery X.kid_dx_pre_lottery X.cancer_dx_pre_lottery
## 1                    0                    0                       0
## 2                    0                    0                       0
## 3                    0                    0                       0
## 4                    0                    0                       0
## 5                    0                    0                       0
## 6                    0                    0                       0
##   X.dep_dx_pre_lottery X.lessHS X.HSorGED X.charg_tot_pre_ed
## 1                    0        0         1                  0
## 2                    0        0         1                  0
## 3                    0        0         1               1888
## 4                    1        1         0                  0
## 5                    0        0         0               1715
## 6                    0        1         0                  0
##   X.ed_charg_tot_pre_ed       Y clate_W Z weights folds   clate clate_se
## 1                     0 -144.00       0 1  1.1504     8  3.5659    4.664
## 2                     0 -134.00       0 0  0.8975     1  3.3977    2.461
## 3                  1888  -84.61       1 0  1.0000    10 86.5757    4.745
## 4                     0 -168.00       0 0  1.2126     3  0.8981    4.609
## 5                  1006 -160.39       0 0  1.0000    10 75.1033    5.278
## 6                     0  -98.00       1 1  1.0033     9  3.2103    3.311
##   clate_ranking_5 clate_ranking_20 cate_W     cate cate_se cate_ranking_5
## 1               2                8      1  1.88542   1.713              3
## 2               2                8      0  0.47401   1.194              2
## 3               5               20      0 28.31469   3.951              5
## 4               1                3      0 -0.08733   2.145              1
## 5               5               18      0 20.69142   2.405              5
## 6               2                8      1  0.09818   1.095              1
##   cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              12       1.88542                       3
## 2               6       0.47401                       2
## 3              20      28.31469                       5
## 4               3      -0.08733                       1
## 5              18      20.69142                       5
## 6               4       0.09818                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       12        1.4572                       3
## 2                        6        0.1755                       2
## 3                       20       27.3270                       5
## 4                        3       -0.6235                       1
## 5                       18       20.0903                       5
## 6                        4       -0.1755                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       12        1.0289                       3
## 2                        6       -0.1231                       2
## 3                       20       26.3393                       5
## 4                        2       -1.1597                       1
## 5                       18       19.4891                       5
## 6                        4       -0.4493                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       11        0.6007                       3
## 2                        6       -0.4216                       2
## 3                       20       25.3516                       5
## 4                        2       -1.6958                       1
## 5                       18       18.8880                       5
## 6                        4       -0.7230                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       11        0.1724                       3
## 2                        6       -0.7201                       2
## 3                       20       24.3639                       5
## 4                        1       -2.2320                       1
## 5                       18       18.2868                       5
## 6                        4       -0.9967                       1
##   cate_lambda_4_ranking_20
## 1                       11
## 2                        6
## 3                       20
## 4                        1
## 5                       18
## 6                        4
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "ohp_all_ever_inperson_cw0_lambda_0"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_ohp_all_ever_inperson_cw0.csv"
## Rows: 12,208
## Columns: 45
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ cate                     <dbl> 0.2242, 0.2154, 0.2668, 0.2787, 0.2692, 0.176…
## $ cate_se                  <dbl> 0.013531, 0.013647, 0.017988, 0.012490, 0.025…
## $ cate_ranking_5           <int> 2, 2, 4, 5, 4, 1, 1, 3, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_ranking_20          <int> 6, 5, 15, 18, 16, 1, 2, 12, 14, 13, 10, 15, 1…
## $ cate_lambda_0            <dbl> 0.2242, 0.2154, 0.2668, 0.2787, 0.2692, 0.176…
## $ cate_lambda_0_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 3, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 6, 5, 15, 18, 16, 1, 2, 12, 14, 13, 10, 14, 1…
## $ cate_lambda_1            <dbl> 0.2209, 0.2120, 0.2623, 0.2756, 0.2627, 0.172…
## $ cate_lambda_1_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 3, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 6, 5, 15, 19, 15, 1, 2, 12, 14, 14, 11, 15, 1…
## $ cate_lambda_2            <dbl> 0.2175, 0.2086, 0.2578, 0.2725, 0.2563, 0.167…
## $ cate_lambda_2_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 3, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 6, 5, 15, 19, 15, 1, 2, 12, 14, 14, 11, 15, 1…
## $ cate_lambda_3            <dbl> 0.2141, 0.2052, 0.2533, 0.2693, 0.2498, 0.163…
## $ cate_lambda_3_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 4, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 7, 5, 16, 19, 15, 1, 2, 13, 15, 15, 12, 15, 1…
## $ cate_lambda_4            <dbl> 0.2107, 0.2017, 0.2488, 0.2662, 0.2434, 0.158…
## $ cate_lambda_4_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 4, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 7, 6, 16, 19, 15, 1, 2, 13, 15, 15, 12, 15, 1…
## [1] "OHP analysis detected - excluding CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12208"
## [2] "Dimensions of selected_ranking_df: 2"    
## [1] "Dimensions of outcome_df: 12094" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12094" "Dimensions of cdf_data: 52"   
##   person_id cate_rankings_selected X.numhh_list X.gender_inp X.age_inp
## 1         5                      2            1            1        60
## 2         8                      2            2            0        41
## 3        16                      4            2            1        39
## 4        17                      5            1            0        52
## 5        18                      4            1            0        51
## 6        23                      1            2            1        32
##   X.hispanic_inp X.race_white_inp X.race_black_inp X.race_nwother_inp
## 1              1                0                0                  0
## 2              0                1                0                  0
## 3              0                1                0                  0
## 4              0                1                0                  0
## 5              0                0                1                  0
## 6              1                0                0                  0
##   X.ast_dx_pre_lottery X.dia_dx_pre_lottery X.hbp_dx_pre_lottery
## 1                    0                    0                    0
## 2                    1                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    1
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chl_dx_pre_lottery X.ami_dx_pre_lottery X.chf_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.emp_dx_pre_lottery X.kid_dx_pre_lottery X.cancer_dx_pre_lottery
## 1                    0                    0                       0
## 2                    0                    0                       0
## 3                    0                    0                       0
## 4                    0                    0                       0
## 5                    0                    0                       0
## 6                    0                    0                       0
##   X.dep_dx_pre_lottery X.lessHS X.HSorGED X.charg_tot_pre_ed
## 1                    0        0         1                  0
## 2                    0        0         1                  0
## 3                    0        0         1               1888
## 4                    1        1         0                  0
## 5                    0        0         0               1715
## 6                    0        1         0                  0
##   X.ed_charg_tot_pre_ed Y clate_W Z weights folds   clate clate_se
## 1                     0 1       0 1  1.1504     8 0.39883  0.16302
## 2                     0 0       0 0  0.8975     1 0.19916  0.10261
## 3                  1888 1       1 0  1.0000    10 0.18745  0.11559
## 4                     0 0       0 0  1.2126     3 0.41306  0.05780
## 5                  1006 1       0 0  1.0000    10 0.23865  0.07205
## 6                     0 0       1 1  1.0033     9 0.02548  0.22824
##   clate_ranking_5 clate_ranking_20 cate_W    cate  cate_se cate_ranking_5
## 1               5               18      1 0.09723 0.009730              5
## 2               1                4      0 0.05205 0.024135              1
## 3               1                3      0 0.04867 0.027492              1
## 4               5               19      0 0.09769 0.019527              5
## 5               2                6      0 0.07025 0.018605              2
## 6               1                1      1 0.02229 0.009796              1
##   cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              19       0.09723                       5
## 2               4       0.05205                       1
## 3               3       0.04867                       1
## 4              19       0.09769                       5
## 5               7       0.07025                       2
## 6               1       0.02229                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       19       0.09480                       5
## 2                        4       0.04601                       1
## 3                        3       0.04180                       1
## 4                       19       0.09281                       5
## 5                        7       0.06560                       2
## 6                        1       0.01984                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       19       0.09237                       5
## 2                        4       0.03998                       1
## 3                        3       0.03492                       1
## 4                       19       0.08793                       5
## 5                        7       0.06095                       2
## 6                        1       0.01739                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       19       0.08994                       5
## 2                        4       0.03395                       1
## 3                        3       0.02805                       1
## 4                       19       0.08304                       5
## 5                        8       0.05629                       2
## 6                        1       0.01494                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       20       0.08750                       5
## 2                        4       0.02791                       1
## 3                        3       0.02118                       1
## 4                       18       0.07816                       5
## 5                        8       0.05164                       2
## 6                        1       0.01249                       1
##   cate_lambda_4_ranking_20
## 1                       20
## 2                        3
## 3                        2
## 4                       18
## 5                        8
## 6                        1
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "ohp_all_ever_inperson_cw0_lambda_0"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_ohp_all_ever_inperson_cw0.csv"
## Rows: 12,208
## Columns: 45
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ cate                     <dbl> 0.2242, 0.2154, 0.2668, 0.2787, 0.2692, 0.176…
## $ cate_se                  <dbl> 0.013531, 0.013647, 0.017988, 0.012490, 0.025…
## $ cate_ranking_5           <int> 2, 2, 4, 5, 4, 1, 1, 3, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_ranking_20          <int> 6, 5, 15, 18, 16, 1, 2, 12, 14, 13, 10, 15, 1…
## $ cate_lambda_0            <dbl> 0.2242, 0.2154, 0.2668, 0.2787, 0.2692, 0.176…
## $ cate_lambda_0_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 3, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 6, 5, 15, 18, 16, 1, 2, 12, 14, 13, 10, 14, 1…
## $ cate_lambda_1            <dbl> 0.2209, 0.2120, 0.2623, 0.2756, 0.2627, 0.172…
## $ cate_lambda_1_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 3, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 6, 5, 15, 19, 15, 1, 2, 12, 14, 14, 11, 15, 1…
## $ cate_lambda_2            <dbl> 0.2175, 0.2086, 0.2578, 0.2725, 0.2563, 0.167…
## $ cate_lambda_2_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 3, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 6, 5, 15, 19, 15, 1, 2, 12, 14, 14, 11, 15, 1…
## $ cate_lambda_3            <dbl> 0.2141, 0.2052, 0.2533, 0.2693, 0.2498, 0.163…
## $ cate_lambda_3_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 4, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 7, 5, 16, 19, 15, 1, 2, 13, 15, 15, 12, 15, 1…
## $ cate_lambda_4            <dbl> 0.2107, 0.2017, 0.2488, 0.2662, 0.2434, 0.158…
## $ cate_lambda_4_ranking_5  <int> 2, 2, 4, 5, 4, 1, 1, 4, 4, 4, 3, 4, 5, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 7, 6, 16, 19, 15, 1, 2, 13, 15, 15, 12, 15, 1…
## [1] "OHP analysis detected - excluding CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12208"
## [2] "Dimensions of selected_ranking_df: 2"    
## [1] "Dimensions of outcome_df: 12151" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12151" "Dimensions of cdf_data: 52"   
##   person_id cate_rankings_selected X.numhh_list X.gender_inp X.age_inp
## 1         5                      2            1            1        60
## 2         8                      2            2            0        41
## 3        16                      4            2            1        39
## 4        17                      5            1            0        52
## 5        18                      4            1            0        51
## 6        23                      1            2            1        32
##   X.hispanic_inp X.race_white_inp X.race_black_inp X.race_nwother_inp
## 1              1                0                0                  0
## 2              0                1                0                  0
## 3              0                1                0                  0
## 4              0                1                0                  0
## 5              0                0                1                  0
## 6              1                0                0                  0
##   X.ast_dx_pre_lottery X.dia_dx_pre_lottery X.hbp_dx_pre_lottery
## 1                    0                    0                    0
## 2                    1                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    1
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chl_dx_pre_lottery X.ami_dx_pre_lottery X.chf_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.emp_dx_pre_lottery X.kid_dx_pre_lottery X.cancer_dx_pre_lottery
## 1                    0                    0                       0
## 2                    0                    0                       0
## 3                    0                    0                       0
## 4                    0                    0                       0
## 5                    0                    0                       0
## 6                    0                    0                       0
##   X.dep_dx_pre_lottery X.lessHS X.HSorGED X.charg_tot_pre_ed
## 1                    0        0         1                  0
## 2                    0        0         1                  0
## 3                    0        0         1               1888
## 4                    1        1         0                  0
## 5                    0        0         0               1715
## 6                    0        1         0                  0
##   X.ed_charg_tot_pre_ed      Y clate_W Z weights folds   clate clate_se
## 1                     0 -48.33       0 1  1.1504     8 -3.2872    3.897
## 2                     0 -51.33       0 0  0.8975     1 -2.8577    1.750
## 3                  1888  -5.64       1 0  1.0000    10 65.0260    1.974
## 4                     0 -51.33       0 0  1.2126     3  0.3029    3.198
## 5                  1006 -61.02       0 0  1.0000    10 58.0718    3.386
## 6                     0 -31.08       1 1  1.0033     9  1.6028    5.641
##   clate_ranking_5 clate_ranking_20 cate_W    cate cate_se cate_ranking_5
## 1               1                2      1 -1.5142  1.4284              1
## 2               1                2      0 -0.6430  0.8423              2
## 3               5               18      0 21.0091  4.0054              5
## 4               2                8      0 -0.1304  1.1931              2
## 5               5               17      0 17.8280  3.7253              5
## 6               3               10      1  0.5509  0.8306              3
##   cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1               2       -1.5142                       1
## 2               5       -0.6430                       2
## 3              19       21.0091                       5
## 4               7       -0.1304                       2
## 5              18       17.8280                       5
## 6              11        0.5509                       3
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                        2       -1.8713                       1
## 2                        5       -0.8536                       2
## 3                       19       20.0077                       5
## 4                        7       -0.4286                       2
## 5                       18       16.8966                       5
## 6                       11        0.3433                       3
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                        2       -2.2284                       1
## 2                        5       -1.0642                       2
## 3                       19       19.0064                       5
## 4                        7       -0.7269                       2
## 5                       18       15.9653                       5
## 6                       11        0.1356                       3
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                        1        -2.585                       1
## 2                        5        -1.275                       2
## 3                       19        18.005                       5
## 4                        7        -1.025                       2
## 5                       17        15.034                       5
## 6                       12        -0.072                       3
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                        1       -2.9426                       1
## 2                        6       -1.4853                       2
## 3                       19       17.0037                       5
## 4                        7       -1.3234                       2
## 5                       17       14.1027                       5
## 6                       12       -0.2796                       3
##   cate_lambda_4_ranking_20
## 1                        1
## 2                        6
## 3                       19
## 4                        7
## 5                       17
## 6                       12
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_1"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12167"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12167" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12167" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      3                       3            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      1                       1            1
## 5        18                      5                       5            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed       Y clate_W Z weights folds
## 1                  0                     0 -144.00       0 1  1.1504     8
## 2                  0                     0 -134.00       0 0  0.8975     1
## 3               1888                  1888  -84.61       1 0  1.0000    10
## 4                  0                     0 -168.00       0 0  1.2126     3
## 5               1715                  1006 -160.39       0 0  1.0000    10
## 6                  0                     0  -98.00       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W     cate cate_se
## 1  3.5659    4.664               2                8      1  1.88542   1.713
## 2  3.3977    2.461               2                8      0  0.47401   1.194
## 3 86.5757    4.745               5               20      0 28.31469   3.951
## 4  0.8981    4.609               1                3      0 -0.08733   2.145
## 5 75.1033    5.278               5               18      0 20.69142   2.405
## 6  3.2103    3.311               2                8      1  0.09818   1.095
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              3              12       1.88542                       3
## 2              2               6       0.47401                       2
## 3              5              20      28.31469                       5
## 4              1               3      -0.08733                       1
## 5              5              18      20.69142                       5
## 6              1               4       0.09818                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       12        1.4572                       3
## 2                        6        0.1755                       2
## 3                       20       27.3270                       5
## 4                        3       -0.6235                       1
## 5                       18       20.0903                       5
## 6                        4       -0.1755                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       12        1.0289                       3
## 2                        6       -0.1231                       2
## 3                       20       26.3393                       5
## 4                        2       -1.1597                       1
## 5                       18       19.4891                       5
## 6                        4       -0.4493                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       11        0.6007                       3
## 2                        6       -0.4216                       2
## 3                       20       25.3516                       5
## 4                        2       -1.6958                       1
## 5                       18       18.8880                       5
## 6                        4       -0.7230                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       11        0.1724                       3
## 2                        6       -0.7201                       2
## 3                       20       24.3639                       5
## 4                        1       -2.2320                       1
## 5                       18       18.2868                       5
## 6                        4       -0.9967                       1
##   cate_lambda_4_ranking_20
## 1                       11
## 2                        6
## 3                       20
## 4                        1
## 5                       18
## 6                        4
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_1"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12094"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12094" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12094" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      5                       5            1
## 2         8                      1                       1            2
## 3        16                      1                       1            2
## 4        17                      5                       5            1
## 5        18                      2                       2            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed Y clate_W Z weights folds   clate
## 1                  0                     0 1       0 1  1.1504     8 0.39883
## 2                  0                     0 0       0 0  0.8975     1 0.19916
## 3               1888                  1888 1       1 0  1.0000    10 0.18745
## 4                  0                     0 0       0 0  1.2126     3 0.41306
## 5               1715                  1006 1       0 0  1.0000    10 0.23865
## 6                  0                     0 0       1 1  1.0033     9 0.02548
##   clate_se clate_ranking_5 clate_ranking_20 cate_W    cate  cate_se
## 1  0.16302               5               18      1 0.09723 0.009730
## 2  0.10261               1                4      0 0.05205 0.024135
## 3  0.11559               1                3      0 0.04867 0.027492
## 4  0.05780               5               19      0 0.09769 0.019527
## 5  0.07205               2                6      0 0.07025 0.018605
## 6  0.22824               1                1      1 0.02229 0.009796
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              5              19       0.09723                       5
## 2              1               4       0.05205                       1
## 3              1               3       0.04867                       1
## 4              5              19       0.09769                       5
## 5              2               7       0.07025                       2
## 6              1               1       0.02229                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       19       0.09480                       5
## 2                        4       0.04601                       1
## 3                        3       0.04180                       1
## 4                       19       0.09281                       5
## 5                        7       0.06560                       2
## 6                        1       0.01984                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       19       0.09237                       5
## 2                        4       0.03998                       1
## 3                        3       0.03492                       1
## 4                       19       0.08793                       5
## 5                        7       0.06095                       2
## 6                        1       0.01739                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       19       0.08994                       5
## 2                        4       0.03395                       1
## 3                        3       0.02805                       1
## 4                       19       0.08304                       5
## 5                        8       0.05629                       2
## 6                        1       0.01494                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       20       0.08750                       5
## 2                        4       0.02791                       1
## 3                        3       0.02118                       1
## 4                       18       0.07816                       5
## 5                        8       0.05164                       2
## 6                        1       0.01249                       1
##   cate_lambda_4_ranking_20
## 1                       20
## 2                        3
## 3                        2
## 4                       18
## 5                        8
## 6                        1
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_1"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12151"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12151" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12151" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      1                       1            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      2                       2            1
## 5        18                      5                       5            1
## 6        23                      3                       3            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed      Y clate_W Z weights folds
## 1                  0                     0 -48.33       0 1  1.1504     8
## 2                  0                     0 -51.33       0 0  0.8975     1
## 3               1888                  1888  -5.64       1 0  1.0000    10
## 4                  0                     0 -51.33       0 0  1.2126     3
## 5               1715                  1006 -61.02       0 0  1.0000    10
## 6                  0                     0 -31.08       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W    cate cate_se
## 1 -3.2872    3.897               1                2      1 -1.5142  1.4284
## 2 -2.8577    1.750               1                2      0 -0.6430  0.8423
## 3 65.0260    1.974               5               18      0 21.0091  4.0054
## 4  0.3029    3.198               2                8      0 -0.1304  1.1931
## 5 58.0718    3.386               5               17      0 17.8280  3.7253
## 6  1.6028    5.641               3               10      1  0.5509  0.8306
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              1               2       -1.5142                       1
## 2              2               5       -0.6430                       2
## 3              5              19       21.0091                       5
## 4              2               7       -0.1304                       2
## 5              5              18       17.8280                       5
## 6              3              11        0.5509                       3
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                        2       -1.8713                       1
## 2                        5       -0.8536                       2
## 3                       19       20.0077                       5
## 4                        7       -0.4286                       2
## 5                       18       16.8966                       5
## 6                       11        0.3433                       3
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                        2       -2.2284                       1
## 2                        5       -1.0642                       2
## 3                       19       19.0064                       5
## 4                        7       -0.7269                       2
## 5                       18       15.9653                       5
## 6                       11        0.1356                       3
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                        1        -2.585                       1
## 2                        5        -1.275                       2
## 3                       19        18.005                       5
## 4                        7        -1.025                       2
## 5                       17        15.034                       5
## 6                       12        -0.072                       3
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                        1       -2.9426                       1
## 2                        6       -1.4853                       2
## 3                       19       17.0037                       5
## 4                        7       -1.3234                       2
## 5                       17       14.1027                       5
## 6                       12       -0.2796                       3
##   cate_lambda_4_ranking_20
## 1                        1
## 2                        6
## 3                       19
## 4                        7
## 5                       17
## 6                       12
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_2"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12167"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12167" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12167" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      3                       3            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      1                       1            1
## 5        18                      5                       5            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed       Y clate_W Z weights folds
## 1                  0                     0 -144.00       0 1  1.1504     8
## 2                  0                     0 -134.00       0 0  0.8975     1
## 3               1888                  1888  -84.61       1 0  1.0000    10
## 4                  0                     0 -168.00       0 0  1.2126     3
## 5               1715                  1006 -160.39       0 0  1.0000    10
## 6                  0                     0  -98.00       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W     cate cate_se
## 1  3.5659    4.664               2                8      1  1.88542   1.713
## 2  3.3977    2.461               2                8      0  0.47401   1.194
## 3 86.5757    4.745               5               20      0 28.31469   3.951
## 4  0.8981    4.609               1                3      0 -0.08733   2.145
## 5 75.1033    5.278               5               18      0 20.69142   2.405
## 6  3.2103    3.311               2                8      1  0.09818   1.095
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              3              12       1.88542                       3
## 2              2               6       0.47401                       2
## 3              5              20      28.31469                       5
## 4              1               3      -0.08733                       1
## 5              5              18      20.69142                       5
## 6              1               4       0.09818                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       12        1.4572                       3
## 2                        6        0.1755                       2
## 3                       20       27.3270                       5
## 4                        3       -0.6235                       1
## 5                       18       20.0903                       5
## 6                        4       -0.1755                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       12        1.0289                       3
## 2                        6       -0.1231                       2
## 3                       20       26.3393                       5
## 4                        2       -1.1597                       1
## 5                       18       19.4891                       5
## 6                        4       -0.4493                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       11        0.6007                       3
## 2                        6       -0.4216                       2
## 3                       20       25.3516                       5
## 4                        2       -1.6958                       1
## 5                       18       18.8880                       5
## 6                        4       -0.7230                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       11        0.1724                       3
## 2                        6       -0.7201                       2
## 3                       20       24.3639                       5
## 4                        1       -2.2320                       1
## 5                       18       18.2868                       5
## 6                        4       -0.9967                       1
##   cate_lambda_4_ranking_20
## 1                       11
## 2                        6
## 3                       20
## 4                        1
## 5                       18
## 6                        4
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_2"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12094"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12094" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12094" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      5                       5            1
## 2         8                      1                       1            2
## 3        16                      1                       1            2
## 4        17                      5                       5            1
## 5        18                      2                       2            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed Y clate_W Z weights folds   clate
## 1                  0                     0 1       0 1  1.1504     8 0.39883
## 2                  0                     0 0       0 0  0.8975     1 0.19916
## 3               1888                  1888 1       1 0  1.0000    10 0.18745
## 4                  0                     0 0       0 0  1.2126     3 0.41306
## 5               1715                  1006 1       0 0  1.0000    10 0.23865
## 6                  0                     0 0       1 1  1.0033     9 0.02548
##   clate_se clate_ranking_5 clate_ranking_20 cate_W    cate  cate_se
## 1  0.16302               5               18      1 0.09723 0.009730
## 2  0.10261               1                4      0 0.05205 0.024135
## 3  0.11559               1                3      0 0.04867 0.027492
## 4  0.05780               5               19      0 0.09769 0.019527
## 5  0.07205               2                6      0 0.07025 0.018605
## 6  0.22824               1                1      1 0.02229 0.009796
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              5              19       0.09723                       5
## 2              1               4       0.05205                       1
## 3              1               3       0.04867                       1
## 4              5              19       0.09769                       5
## 5              2               7       0.07025                       2
## 6              1               1       0.02229                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       19       0.09480                       5
## 2                        4       0.04601                       1
## 3                        3       0.04180                       1
## 4                       19       0.09281                       5
## 5                        7       0.06560                       2
## 6                        1       0.01984                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       19       0.09237                       5
## 2                        4       0.03998                       1
## 3                        3       0.03492                       1
## 4                       19       0.08793                       5
## 5                        7       0.06095                       2
## 6                        1       0.01739                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       19       0.08994                       5
## 2                        4       0.03395                       1
## 3                        3       0.02805                       1
## 4                       19       0.08304                       5
## 5                        8       0.05629                       2
## 6                        1       0.01494                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       20       0.08750                       5
## 2                        4       0.02791                       1
## 3                        3       0.02118                       1
## 4                       18       0.07816                       5
## 5                        8       0.05164                       2
## 6                        1       0.01249                       1
##   cate_lambda_4_ranking_20
## 1                       20
## 2                        3
## 3                        2
## 4                       18
## 5                        8
## 6                        1
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_2"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12151"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12151" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12151" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      1                       1            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      2                       2            1
## 5        18                      5                       5            1
## 6        23                      3                       3            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed      Y clate_W Z weights folds
## 1                  0                     0 -48.33       0 1  1.1504     8
## 2                  0                     0 -51.33       0 0  0.8975     1
## 3               1888                  1888  -5.64       1 0  1.0000    10
## 4                  0                     0 -51.33       0 0  1.2126     3
## 5               1715                  1006 -61.02       0 0  1.0000    10
## 6                  0                     0 -31.08       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W    cate cate_se
## 1 -3.2872    3.897               1                2      1 -1.5142  1.4284
## 2 -2.8577    1.750               1                2      0 -0.6430  0.8423
## 3 65.0260    1.974               5               18      0 21.0091  4.0054
## 4  0.3029    3.198               2                8      0 -0.1304  1.1931
## 5 58.0718    3.386               5               17      0 17.8280  3.7253
## 6  1.6028    5.641               3               10      1  0.5509  0.8306
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              1               2       -1.5142                       1
## 2              2               5       -0.6430                       2
## 3              5              19       21.0091                       5
## 4              2               7       -0.1304                       2
## 5              5              18       17.8280                       5
## 6              3              11        0.5509                       3
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                        2       -1.8713                       1
## 2                        5       -0.8536                       2
## 3                       19       20.0077                       5
## 4                        7       -0.4286                       2
## 5                       18       16.8966                       5
## 6                       11        0.3433                       3
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                        2       -2.2284                       1
## 2                        5       -1.0642                       2
## 3                       19       19.0064                       5
## 4                        7       -0.7269                       2
## 5                       18       15.9653                       5
## 6                       11        0.1356                       3
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                        1        -2.585                       1
## 2                        5        -1.275                       2
## 3                       19        18.005                       5
## 4                        7        -1.025                       2
## 5                       17        15.034                       5
## 6                       12        -0.072                       3
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                        1       -2.9426                       1
## 2                        6       -1.4853                       2
## 3                       19       17.0037                       5
## 4                        7       -1.3234                       2
## 5                       17       14.1027                       5
## 6                       12       -0.2796                       3
##   cate_lambda_4_ranking_20
## 1                        1
## 2                        6
## 3                       19
## 4                        7
## 5                       17
## 6                       12
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_3"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12167"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12167" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12167" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      3                       3            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      1                       1            1
## 5        18                      5                       5            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed       Y clate_W Z weights folds
## 1                  0                     0 -144.00       0 1  1.1504     8
## 2                  0                     0 -134.00       0 0  0.8975     1
## 3               1888                  1888  -84.61       1 0  1.0000    10
## 4                  0                     0 -168.00       0 0  1.2126     3
## 5               1715                  1006 -160.39       0 0  1.0000    10
## 6                  0                     0  -98.00       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W     cate cate_se
## 1  3.5659    4.664               2                8      1  1.88542   1.713
## 2  3.3977    2.461               2                8      0  0.47401   1.194
## 3 86.5757    4.745               5               20      0 28.31469   3.951
## 4  0.8981    4.609               1                3      0 -0.08733   2.145
## 5 75.1033    5.278               5               18      0 20.69142   2.405
## 6  3.2103    3.311               2                8      1  0.09818   1.095
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              3              12       1.88542                       3
## 2              2               6       0.47401                       2
## 3              5              20      28.31469                       5
## 4              1               3      -0.08733                       1
## 5              5              18      20.69142                       5
## 6              1               4       0.09818                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       12        1.4572                       3
## 2                        6        0.1755                       2
## 3                       20       27.3270                       5
## 4                        3       -0.6235                       1
## 5                       18       20.0903                       5
## 6                        4       -0.1755                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       12        1.0289                       3
## 2                        6       -0.1231                       2
## 3                       20       26.3393                       5
## 4                        2       -1.1597                       1
## 5                       18       19.4891                       5
## 6                        4       -0.4493                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       11        0.6007                       3
## 2                        6       -0.4216                       2
## 3                       20       25.3516                       5
## 4                        2       -1.6958                       1
## 5                       18       18.8880                       5
## 6                        4       -0.7230                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       11        0.1724                       3
## 2                        6       -0.7201                       2
## 3                       20       24.3639                       5
## 4                        1       -2.2320                       1
## 5                       18       18.2868                       5
## 6                        4       -0.9967                       1
##   cate_lambda_4_ranking_20
## 1                       11
## 2                        6
## 3                       20
## 4                        1
## 5                       18
## 6                        4
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_3"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12094"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12094" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12094" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      5                       5            1
## 2         8                      1                       1            2
## 3        16                      1                       1            2
## 4        17                      5                       5            1
## 5        18                      2                       2            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed Y clate_W Z weights folds   clate
## 1                  0                     0 1       0 1  1.1504     8 0.39883
## 2                  0                     0 0       0 0  0.8975     1 0.19916
## 3               1888                  1888 1       1 0  1.0000    10 0.18745
## 4                  0                     0 0       0 0  1.2126     3 0.41306
## 5               1715                  1006 1       0 0  1.0000    10 0.23865
## 6                  0                     0 0       1 1  1.0033     9 0.02548
##   clate_se clate_ranking_5 clate_ranking_20 cate_W    cate  cate_se
## 1  0.16302               5               18      1 0.09723 0.009730
## 2  0.10261               1                4      0 0.05205 0.024135
## 3  0.11559               1                3      0 0.04867 0.027492
## 4  0.05780               5               19      0 0.09769 0.019527
## 5  0.07205               2                6      0 0.07025 0.018605
## 6  0.22824               1                1      1 0.02229 0.009796
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              5              19       0.09723                       5
## 2              1               4       0.05205                       1
## 3              1               3       0.04867                       1
## 4              5              19       0.09769                       5
## 5              2               7       0.07025                       2
## 6              1               1       0.02229                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       19       0.09480                       5
## 2                        4       0.04601                       1
## 3                        3       0.04180                       1
## 4                       19       0.09281                       5
## 5                        7       0.06560                       2
## 6                        1       0.01984                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       19       0.09237                       5
## 2                        4       0.03998                       1
## 3                        3       0.03492                       1
## 4                       19       0.08793                       5
## 5                        7       0.06095                       2
## 6                        1       0.01739                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       19       0.08994                       5
## 2                        4       0.03395                       1
## 3                        3       0.02805                       1
## 4                       19       0.08304                       5
## 5                        8       0.05629                       2
## 6                        1       0.01494                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       20       0.08750                       5
## 2                        4       0.02791                       1
## 3                        3       0.02118                       1
## 4                       18       0.07816                       5
## 5                        8       0.05164                       2
## 6                        1       0.01249                       1
##   cate_lambda_4_ranking_20
## 1                       20
## 2                        3
## 3                        2
## 4                       18
## 5                        8
## 6                        1
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_3"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12151"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12151" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12151" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      1                       1            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      2                       2            1
## 5        18                      5                       5            1
## 6        23                      3                       3            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed      Y clate_W Z weights folds
## 1                  0                     0 -48.33       0 1  1.1504     8
## 2                  0                     0 -51.33       0 0  0.8975     1
## 3               1888                  1888  -5.64       1 0  1.0000    10
## 4                  0                     0 -51.33       0 0  1.2126     3
## 5               1715                  1006 -61.02       0 0  1.0000    10
## 6                  0                     0 -31.08       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W    cate cate_se
## 1 -3.2872    3.897               1                2      1 -1.5142  1.4284
## 2 -2.8577    1.750               1                2      0 -0.6430  0.8423
## 3 65.0260    1.974               5               18      0 21.0091  4.0054
## 4  0.3029    3.198               2                8      0 -0.1304  1.1931
## 5 58.0718    3.386               5               17      0 17.8280  3.7253
## 6  1.6028    5.641               3               10      1  0.5509  0.8306
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              1               2       -1.5142                       1
## 2              2               5       -0.6430                       2
## 3              5              19       21.0091                       5
## 4              2               7       -0.1304                       2
## 5              5              18       17.8280                       5
## 6              3              11        0.5509                       3
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                        2       -1.8713                       1
## 2                        5       -0.8536                       2
## 3                       19       20.0077                       5
## 4                        7       -0.4286                       2
## 5                       18       16.8966                       5
## 6                       11        0.3433                       3
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                        2       -2.2284                       1
## 2                        5       -1.0642                       2
## 3                       19       19.0064                       5
## 4                        7       -0.7269                       2
## 5                       18       15.9653                       5
## 6                       11        0.1356                       3
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                        1        -2.585                       1
## 2                        5        -1.275                       2
## 3                       19        18.005                       5
## 4                        7        -1.025                       2
## 5                       17        15.034                       5
## 6                       12        -0.072                       3
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                        1       -2.9426                       1
## 2                        6       -1.4853                       2
## 3                       19       17.0037                       5
## 4                        7       -1.3234                       2
## 5                       17       14.1027                       5
## 6                       12       -0.2796                       3
##   cate_lambda_4_ranking_20
## 1                        1
## 2                        6
## 3                       19
## 4                        7
## 5                       17
## 6                       12
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_4"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12167"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12167" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12167" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      3                       3            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      1                       1            1
## 5        18                      5                       5            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed       Y clate_W Z weights folds
## 1                  0                     0 -144.00       0 1  1.1504     8
## 2                  0                     0 -134.00       0 0  0.8975     1
## 3               1888                  1888  -84.61       1 0  1.0000    10
## 4                  0                     0 -168.00       0 0  1.2126     3
## 5               1715                  1006 -160.39       0 0  1.0000    10
## 6                  0                     0  -98.00       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W     cate cate_se
## 1  3.5659    4.664               2                8      1  1.88542   1.713
## 2  3.3977    2.461               2                8      0  0.47401   1.194
## 3 86.5757    4.745               5               20      0 28.31469   3.951
## 4  0.8981    4.609               1                3      0 -0.08733   2.145
## 5 75.1033    5.278               5               18      0 20.69142   2.405
## 6  3.2103    3.311               2                8      1  0.09818   1.095
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              3              12       1.88542                       3
## 2              2               6       0.47401                       2
## 3              5              20      28.31469                       5
## 4              1               3      -0.08733                       1
## 5              5              18      20.69142                       5
## 6              1               4       0.09818                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       12        1.4572                       3
## 2                        6        0.1755                       2
## 3                       20       27.3270                       5
## 4                        3       -0.6235                       1
## 5                       18       20.0903                       5
## 6                        4       -0.1755                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       12        1.0289                       3
## 2                        6       -0.1231                       2
## 3                       20       26.3393                       5
## 4                        2       -1.1597                       1
## 5                       18       19.4891                       5
## 6                        4       -0.4493                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       11        0.6007                       3
## 2                        6       -0.4216                       2
## 3                       20       25.3516                       5
## 4                        2       -1.6958                       1
## 5                       18       18.8880                       5
## 6                        4       -0.7230                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       11        0.1724                       3
## 2                        6       -0.7201                       2
## 3                       20       24.3639                       5
## 4                        1       -2.2320                       1
## 5                       18       18.2868                       5
## 6                        4       -0.9967                       1
##   cate_lambda_4_ranking_20
## 1                       11
## 2                        6
## 3                       20
## 4                        1
## 5                       18
## 6                        4
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_4"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12094"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12094" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12094" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      5                       5            1
## 2         8                      1                       1            2
## 3        16                      1                       1            2
## 4        17                      5                       5            1
## 5        18                      2                       2            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed Y clate_W Z weights folds   clate
## 1                  0                     0 1       0 1  1.1504     8 0.39883
## 2                  0                     0 0       0 0  0.8975     1 0.19916
## 3               1888                  1888 1       1 0  1.0000    10 0.18745
## 4                  0                     0 0       0 0  1.2126     3 0.41306
## 5               1715                  1006 1       0 0  1.0000    10 0.23865
## 6                  0                     0 0       1 1  1.0033     9 0.02548
##   clate_se clate_ranking_5 clate_ranking_20 cate_W    cate  cate_se
## 1  0.16302               5               18      1 0.09723 0.009730
## 2  0.10261               1                4      0 0.05205 0.024135
## 3  0.11559               1                3      0 0.04867 0.027492
## 4  0.05780               5               19      0 0.09769 0.019527
## 5  0.07205               2                6      0 0.07025 0.018605
## 6  0.22824               1                1      1 0.02229 0.009796
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              5              19       0.09723                       5
## 2              1               4       0.05205                       1
## 3              1               3       0.04867                       1
## 4              5              19       0.09769                       5
## 5              2               7       0.07025                       2
## 6              1               1       0.02229                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       19       0.09480                       5
## 2                        4       0.04601                       1
## 3                        3       0.04180                       1
## 4                       19       0.09281                       5
## 5                        7       0.06560                       2
## 6                        1       0.01984                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       19       0.09237                       5
## 2                        4       0.03998                       1
## 3                        3       0.03492                       1
## 4                       19       0.08793                       5
## 5                        7       0.06095                       2
## 6                        1       0.01739                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       19       0.08994                       5
## 2                        4       0.03395                       1
## 3                        3       0.02805                       1
## 4                       19       0.08304                       5
## 5                        8       0.05629                       2
## 6                        1       0.01494                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       20       0.08750                       5
## 2                        4       0.02791                       1
## 3                        3       0.02118                       1
## 4                       18       0.07816                       5
## 5                        8       0.05164                       2
## 6                        1       0.01249                       1
##   cate_lambda_4_ranking_20
## 1                       20
## 2                        3
## 3                        2
## 4                       18
## 5                        8
## 6                        1
## [1] "cate"
## [1] "#####Running cate function.#####"

## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_4"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12151"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12151" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12151" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      1                       1            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      2                       2            1
## 5        18                      5                       5            1
## 6        23                      3                       3            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed      Y clate_W Z weights folds
## 1                  0                     0 -48.33       0 1  1.1504     8
## 2                  0                     0 -51.33       0 0  0.8975     1
## 3               1888                  1888  -5.64       1 0  1.0000    10
## 4                  0                     0 -51.33       0 0  1.2126     3
## 5               1715                  1006 -61.02       0 0  1.0000    10
## 6                  0                     0 -31.08       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W    cate cate_se
## 1 -3.2872    3.897               1                2      1 -1.5142  1.4284
## 2 -2.8577    1.750               1                2      0 -0.6430  0.8423
## 3 65.0260    1.974               5               18      0 21.0091  4.0054
## 4  0.3029    3.198               2                8      0 -0.1304  1.1931
## 5 58.0718    3.386               5               17      0 17.8280  3.7253
## 6  1.6028    5.641               3               10      1  0.5509  0.8306
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              1               2       -1.5142                       1
## 2              2               5       -0.6430                       2
## 3              5              19       21.0091                       5
## 4              2               7       -0.1304                       2
## 5              5              18       17.8280                       5
## 6              3              11        0.5509                       3
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                        2       -1.8713                       1
## 2                        5       -0.8536                       2
## 3                       19       20.0077                       5
## 4                        7       -0.4286                       2
## 5                       18       16.8966                       5
## 6                       11        0.3433                       3
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                        2       -2.2284                       1
## 2                        5       -1.0642                       2
## 3                       19       19.0064                       5
## 4                        7       -0.7269                       2
## 5                       18       15.9653                       5
## 6                       11        0.1356                       3
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                        1        -2.585                       1
## 2                        5        -1.275                       2
## 3                       19        18.005                       5
## 4                        7        -1.025                       2
## 5                       17        15.034                       5
## 6                       12        -0.072                       3
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                        1       -2.9426                       1
## 2                        6       -1.4853                       2
## 3                       19       17.0037                       5
## 4                        7       -1.3234                       2
## 5                       17       14.1027                       5
## 6                       12       -0.2796                       3
##   cate_lambda_4_ranking_20
## 1                        1
## 2                        6
## 3                       19
## 4                        7
## 5                       17
## 6                       12
## [1] "cate"
## [1] "#####Running cate function.#####"

# Iterate over pairs for clate treatment effect
for (i in seq_along(clate_outcome_rankvar_pairs)) {
    outcome <- clate_outcome_rankvar_pairs[[i]][[1]]         
    ranking_variable <- clate_outcome_rankvar_pairs[[i]][[2]]
    
    # Create plot 
    create_quintile_outcome_plots(outcome, ranking_variable, "clate")
}
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "#####Creating dataframe.#####"
## [1] "cate_lambda_0_ranking_5"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## [1] "outcome_df:"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12167"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12167" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12167" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      3                       2            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      1                       1            1
## 5        18                      5                       5            1
## 6        23                      1                       2            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed       Y clate_W Z weights folds
## 1                  0                     0 -144.00       0 1  1.1504     8
## 2                  0                     0 -134.00       0 0  0.8975     1
## 3               1888                  1888  -84.61       1 0  1.0000    10
## 4                  0                     0 -168.00       0 0  1.2126     3
## 5               1715                  1006 -160.39       0 0  1.0000    10
## 6                  0                     0  -98.00       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W     cate cate_se
## 1  3.5659    4.664               2                8      1  1.88542   1.713
## 2  3.3977    2.461               2                8      0  0.47401   1.194
## 3 86.5757    4.745               5               20      0 28.31469   3.951
## 4  0.8981    4.609               1                3      0 -0.08733   2.145
## 5 75.1033    5.278               5               18      0 20.69142   2.405
## 6  3.2103    3.311               2                8      1  0.09818   1.095
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              3              12       1.88542                       3
## 2              2               6       0.47401                       2
## 3              5              20      28.31469                       5
## 4              1               3      -0.08733                       1
## 5              5              18      20.69142                       5
## 6              1               4       0.09818                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       12        1.4572                       3
## 2                        6        0.1755                       2
## 3                       20       27.3270                       5
## 4                        3       -0.6235                       1
## 5                       18       20.0903                       5
## 6                        4       -0.1755                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       12        1.0289                       3
## 2                        6       -0.1231                       2
## 3                       20       26.3393                       5
## 4                        2       -1.1597                       1
## 5                       18       19.4891                       5
## 6                        4       -0.4493                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       11        0.6007                       3
## 2                        6       -0.4216                       2
## 3                       20       25.3516                       5
## 4                        2       -1.6958                       1
## 5                       18       18.8880                       5
## 6                        4       -0.7230                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       11        0.1724                       3
## 2                        6       -0.7201                       2
## 3                       20       24.3639                       5
## 4                        1       -2.2320                       1
## 5                       18       18.2868                       5
## 6                        4       -0.9967                       1
##   cate_lambda_4_ranking_20
## 1                       11
## 2                        6
## 3                       20
## 4                        1
## 5                       18
## 6                        4
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -151.08   -7.10    1.52    9.53   60.08 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -99.2398     1.3249  -74.91   <2e-16 ***
## clate_W        6.7203     2.7198    2.47    0.014 *  
## X.gender_inp   8.3308     0.6831   12.19   <2e-16 ***
## X.age_inp     -0.7098     0.0283  -25.11   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2454    133.19  <2e-16 ***
## Wu-Hausman          1 2453      3.82   0.051 .  
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.4 on 2454 degrees of freedom
## Multiple R-Squared: 0.263,   Adjusted R-squared: 0.262 
## Wald test:  314 on 3 and 2454 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -135.20   -7.73    1.22   10.01   47.82 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -103.2850     1.2232   -84.4   <2e-16 ***
## clate_W         4.3826     2.5740     1.7    0.089 .  
## X.gender_inp    8.2962     0.6538    12.7   <2e-16 ***
## X.age_inp      -0.5239     0.0255   -20.6   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2410    161.60  <2e-16 ***
## Wu-Hausman          1 2409      1.45    0.23    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.7 on 2410 degrees of freedom
## Multiple R-Squared: 0.205,   Adjusted R-squared: 0.204 
## Wald test:  214 on 3 and 2410 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -111.94   -8.35    2.12   10.65   49.11 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -104.3886     1.4127  -73.89   <2e-16 ***
## clate_W        -0.1351     2.5267   -0.05     0.96    
## X.gender_inp    9.2763     0.6390   14.52   <2e-16 ***
## X.age_inp      -0.4825     0.0273  -17.70   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2398    199.80  <2e-16 ***
## Wu-Hausman          1 2397      1.17    0.28    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.8 on 2398 degrees of freedom
## Multiple R-Squared: 0.172,   Adjusted R-squared: 0.171 
## Wald test:  166 on 3 and 2398 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -104.73  -13.84    1.17   16.06   69.88 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -123.2222     1.9674  -62.63  < 2e-16 ***
## clate_W        22.8154     3.5370    6.45  1.3e-10 ***
## X.gender_inp    8.2713     0.8929    9.26  < 2e-16 ***
## X.age_inp      -0.3017     0.0349   -8.65  < 2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2467    175.37  <2e-16 ***
## Wu-Hausman          1 2466      3.22   0.073 .  
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 23.1 on 2467 degrees of freedom
## Multiple R-Squared: 0.33,    Adjusted R-squared: 0.329 
## Wald test: 97.9 on 3 and 2467 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -142.43   -9.23    1.62   10.98   87.52 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -142.0116     1.5550   -91.3   <2e-16 ***
## clate_W        76.8174     2.2846    33.6   <2e-16 ***
## X.gender_inp    7.5509     0.7214    10.5   <2e-16 ***
## X.age_inp      -0.4976     0.0292   -17.1   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415     242.3 < 2e-16 ***
## Wu-Hausman          1 2414      12.4 0.00044 ***
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.1 on 2415 degrees of freedom
## Multiple R-Squared: 0.869,   Adjusted R-squared: 0.868 
## Wald test:  760 on 3 and 2415 DF,  p-value: <2e-16 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "#####Creating dataframe.#####"
## [1] "cate_lambda_0_ranking_5"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## [1] "outcome_df:"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12094"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12094" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12094" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      5                       5            1
## 2         8                      1                       1            2
## 3        16                      1                       1            2
## 4        17                      5                       5            1
## 5        18                      2                       2            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed Y clate_W Z weights folds   clate
## 1                  0                     0 1       0 1  1.1504     8 0.39883
## 2                  0                     0 0       0 0  0.8975     1 0.19916
## 3               1888                  1888 1       1 0  1.0000    10 0.18745
## 4                  0                     0 0       0 0  1.2126     3 0.41306
## 5               1715                  1006 1       0 0  1.0000    10 0.23865
## 6                  0                     0 0       1 1  1.0033     9 0.02548
##   clate_se clate_ranking_5 clate_ranking_20 cate_W    cate  cate_se
## 1  0.16302               5               18      1 0.09723 0.009730
## 2  0.10261               1                4      0 0.05205 0.024135
## 3  0.11559               1                3      0 0.04867 0.027492
## 4  0.05780               5               19      0 0.09769 0.019527
## 5  0.07205               2                6      0 0.07025 0.018605
## 6  0.22824               1                1      1 0.02229 0.009796
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              5              19       0.09723                       5
## 2              1               4       0.05205                       1
## 3              1               3       0.04867                       1
## 4              5              19       0.09769                       5
## 5              2               7       0.07025                       2
## 6              1               1       0.02229                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       19       0.09480                       5
## 2                        4       0.04601                       1
## 3                        3       0.04180                       1
## 4                       19       0.09281                       5
## 5                        7       0.06560                       2
## 6                        1       0.01984                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       19       0.09237                       5
## 2                        4       0.03998                       1
## 3                        3       0.03492                       1
## 4                       19       0.08793                       5
## 5                        7       0.06095                       2
## 6                        1       0.01739                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       19       0.08994                       5
## 2                        4       0.03395                       1
## 3                        3       0.02805                       1
## 4                       19       0.08304                       5
## 5                        8       0.05629                       2
## 6                        1       0.01494                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       20       0.08750                       5
## 2                        4       0.02791                       1
## 3                        3       0.02118                       1
## 4                       18       0.07816                       5
## 5                        8       0.05164                       2
## 6                        1       0.01249                       1
##   cate_lambda_4_ranking_20
## 1                       20
## 2                        3
## 3                        2
## 4                       18
## 5                        8
## 6                        1
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.528 -0.466 -0.330  0.554  1.770 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.39670    0.05552    7.14  1.2e-12 ***
## clate_W       0.29632    0.11184    2.65   0.0081 ** 
## X.gender_inp -0.11239    0.02703   -4.16  3.3e-05 ***
## X.age_inp     0.00149    0.00113    1.31   0.1895    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415    100.57  <2e-16 ***
## Wu-Hausman          1 2414      0.66    0.42    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.553 on 2415 degrees of freedom
## Multiple R-Squared: 0.0324,  Adjusted R-squared: 0.0312 
## Wald test: 5.86 on 3 and 2415 DF,  p-value: 0.000555 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.948 -0.322 -0.234  0.412  2.478 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.24196    0.04321    5.60  2.4e-08 ***
## clate_W       0.39122    0.07866    4.97  7.0e-07 ***
## X.gender_inp -0.08017    0.02335   -3.43  0.00061 ***
## X.age_inp     0.00158    0.00084    1.88  0.06011 .  
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2410    181.09  <2e-16 ***
## Wu-Hausman          1 2409      2.09    0.15    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.527 on 2410 degrees of freedom
## Multiple R-Squared: 0.0617,  Adjusted R-squared: 0.0605 
## Wald test: 8.88 on 3 and 2410 DF,  p-value: 7.48e-06 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.223 -0.358 -0.282  0.471  2.002 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.276435   0.042397    6.52  8.5e-11 ***
## clate_W       0.290877   0.076268    3.81  0.00014 ***
## X.gender_inp -0.059921   0.020369   -2.94  0.00329 ** 
## X.age_inp     0.001368   0.000831    1.65  0.09978 .  
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2411    197.17  <2e-16 ***
## Wu-Hausman          1 2410      0.64    0.43    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.528 on 2411 degrees of freedom
## Multiple R-Squared: 0.0479,  Adjusted R-squared: 0.0467 
## Wald test: 6.89 on 3 and 2411 DF,  p-value: 0.000128 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.541 -0.421 -0.301  0.571  1.911 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.470429   0.041978   11.21  < 2e-16 ***
## clate_W       0.258665   0.077494    3.34  0.00086 ***
## X.gender_inp -0.103301   0.020286   -5.09  3.8e-07 ***
## X.age_inp    -0.001469   0.000827   -1.78  0.07584 .  
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2402     204.6  <2e-16 ***
## Wu-Hausman          1 2401       0.1    0.75    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.534 on 2402 degrees of freedom
## Multiple R-Squared: 0.0545,  Adjusted R-squared: 0.0534 
## Wald test: 11.2 on 3 and 2402 DF,  p-value: 2.88e-07 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.318 -0.400 -0.322  0.599  1.465 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.418013   0.047877    8.73  < 2e-16 ***
## clate_W       0.309136   0.071952    4.30  1.8e-05 ***
## X.gender_inp -0.065200   0.021046   -3.10    0.002 ** 
## X.age_inp    -0.000629   0.000828   -0.76    0.448    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2429    238.63  <2e-16 ***
## Wu-Hausman          1 2428      0.24    0.62    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.534 on 2429 degrees of freedom
## Multiple R-Squared: 0.0643,  Adjusted R-squared: 0.0632 
## Wald test: 8.12 on 3 and 2429 DF,  p-value: 2.24e-05 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "#####Creating dataframe.#####"
## [1] "cate_lambda_0_ranking_5"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## [1] "outcome_df:"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12151"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12151" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12151" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      1                       1            1
## 2         8                      2                       1            2
## 3        16                      5                       5            2
## 4        17                      2                       2            1
## 5        18                      5                       5            1
## 6        23                      3                       3            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed      Y clate_W Z weights folds
## 1                  0                     0 -48.33       0 1  1.1504     8
## 2                  0                     0 -51.33       0 0  0.8975     1
## 3               1888                  1888  -5.64       1 0  1.0000    10
## 4                  0                     0 -51.33       0 0  1.2126     3
## 5               1715                  1006 -61.02       0 0  1.0000    10
## 6                  0                     0 -31.08       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W    cate cate_se
## 1 -3.2872    3.897               1                2      1 -1.5142  1.4284
## 2 -2.8577    1.750               1                2      0 -0.6430  0.8423
## 3 65.0260    1.974               5               18      0 21.0091  4.0054
## 4  0.3029    3.198               2                8      0 -0.1304  1.1931
## 5 58.0718    3.386               5               17      0 17.8280  3.7253
## 6  1.6028    5.641               3               10      1  0.5509  0.8306
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              1               2       -1.5142                       1
## 2              2               5       -0.6430                       2
## 3              5              19       21.0091                       5
## 4              2               7       -0.1304                       2
## 5              5              18       17.8280                       5
## 6              3              11        0.5509                       3
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                        2       -1.8713                       1
## 2                        5       -0.8536                       2
## 3                       19       20.0077                       5
## 4                        7       -0.4286                       2
## 5                       18       16.8966                       5
## 6                       11        0.3433                       3
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                        2       -2.2284                       1
## 2                        5       -1.0642                       2
## 3                       19       19.0064                       5
## 4                        7       -0.7269                       2
## 5                       18       15.9653                       5
## 6                       11        0.1356                       3
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                        1        -2.585                       1
## 2                        5        -1.275                       2
## 3                       19        18.005                       5
## 4                        7        -1.025                       2
## 5                       17        15.034                       5
## 6                       12        -0.072                       3
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                        1       -2.9426                       1
## 2                        6       -1.4853                       2
## 3                       19       17.0037                       5
## 4                        7       -1.3234                       2
## 5                       17       14.1027                       5
## 6                       12       -0.2796                       3
##   cate_lambda_4_ranking_20
## 1                        1
## 2                        6
## 3                       19
## 4                        7
## 5                       17
## 6                       12
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -85.87  -8.49   1.28  10.14  64.86 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -45.78865    1.44641  -31.66  < 2e-16 ***
## clate_W       -2.18467    2.30757   -0.95     0.34    
## X.gender_inp  -4.58372    0.58943   -7.78  1.1e-14 ***
## X.age_inp     -0.00128    0.02703   -0.05     0.96    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2425    197.58  <2e-16 ***
## Wu-Hausman          1 2424      1.73    0.19    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.3 on 2425 degrees of freedom
## Multiple R-Squared: 0.0211,  Adjusted R-squared: 0.0198 
## Wald test: 24.3 on 3 and 2425 DF,  p-value: 1.81e-15 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -59.565  -8.845   0.889   9.537  58.242 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -46.3364     1.2628  -36.69  < 2e-16 ***
## clate_W        7.4533     2.3065    3.23   0.0012 ** 
## X.gender_inp  -4.5082     0.5782   -7.80  9.3e-15 ***
## X.age_inp     -0.0297     0.0260   -1.14   0.2538    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2411    175.26  <2e-16 ***
## Wu-Hausman          1 2410      6.77  0.0093 ** 
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.5 on 2411 degrees of freedom
## Multiple R-Squared: -0.00947,    Adjusted R-squared: -0.0107 
## Wald test: 22.8 on 3 and 2411 DF,  p-value: 1.39e-14 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -96.07  -8.30   1.26   9.35  60.34 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -41.1599     1.2256  -33.58   <2e-16 ***
## clate_W       -5.6937     2.2628   -2.52   0.0119 *  
## X.gender_inp  -1.2637     0.5660   -2.23   0.0257 *  
## X.age_inp     -0.1015     0.0291   -3.48   0.0005 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2421    176.44  <2e-16 ***
## Wu-Hausman          1 2420      8.07  0.0045 ** 
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.4 on 2421 degrees of freedom
## Multiple R-Squared: -0.0349, Adjusted R-squared: -0.0362 
## Wald test: 9.95 on 3 and 2421 DF,  p-value: 1.62e-06 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -74.56 -10.70   0.63  12.41  89.07 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -50.7960     1.5402  -32.98  < 2e-16 ***
## clate_W       15.9445     3.0498    5.23  1.9e-07 ***
## X.gender_inp  -0.8228     0.8310   -0.99     0.32    
## X.age_inp     -0.1487     0.0315   -4.73  2.4e-06 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2440    142.33  <2e-16 ***
## Wu-Hausman          1 2439      3.46   0.063 .  
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.4 on 2440 degrees of freedom
## Multiple R-Squared: 0.262,   Adjusted R-squared: 0.261 
## Wald test: 19.3 on 3 and 2440 DF,  p-value: 2.33e-12 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -67.26  -7.86   1.41   9.68  46.35 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -74.4634     1.2675  -58.75  < 2e-16 ***
## clate_W       67.0824     1.8888   35.52  < 2e-16 ***
## X.gender_inp  -3.2713     0.5810   -5.63  2.0e-08 ***
## X.age_inp     -0.0932     0.0231   -4.04  5.5e-05 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2413       224  <2e-16 ***
## Wu-Hausman          1 2412         0       1    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.5 on 2413 degrees of freedom
## Multiple R-Squared: 0.862,   Adjusted R-squared: 0.861 
## Wald test:  467 on 3 and 2413 DF,  p-value: <2e-16 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_1"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12167"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12167" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12167" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      3                       3            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      1                       1            1
## 5        18                      5                       5            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed       Y clate_W Z weights folds
## 1                  0                     0 -144.00       0 1  1.1504     8
## 2                  0                     0 -134.00       0 0  0.8975     1
## 3               1888                  1888  -84.61       1 0  1.0000    10
## 4                  0                     0 -168.00       0 0  1.2126     3
## 5               1715                  1006 -160.39       0 0  1.0000    10
## 6                  0                     0  -98.00       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W     cate cate_se
## 1  3.5659    4.664               2                8      1  1.88542   1.713
## 2  3.3977    2.461               2                8      0  0.47401   1.194
## 3 86.5757    4.745               5               20      0 28.31469   3.951
## 4  0.8981    4.609               1                3      0 -0.08733   2.145
## 5 75.1033    5.278               5               18      0 20.69142   2.405
## 6  3.2103    3.311               2                8      1  0.09818   1.095
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              3              12       1.88542                       3
## 2              2               6       0.47401                       2
## 3              5              20      28.31469                       5
## 4              1               3      -0.08733                       1
## 5              5              18      20.69142                       5
## 6              1               4       0.09818                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       12        1.4572                       3
## 2                        6        0.1755                       2
## 3                       20       27.3270                       5
## 4                        3       -0.6235                       1
## 5                       18       20.0903                       5
## 6                        4       -0.1755                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       12        1.0289                       3
## 2                        6       -0.1231                       2
## 3                       20       26.3393                       5
## 4                        2       -1.1597                       1
## 5                       18       19.4891                       5
## 6                        4       -0.4493                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       11        0.6007                       3
## 2                        6       -0.4216                       2
## 3                       20       25.3516                       5
## 4                        2       -1.6958                       1
## 5                       18       18.8880                       5
## 6                        4       -0.7230                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       11        0.1724                       3
## 2                        6       -0.7201                       2
## 3                       20       24.3639                       5
## 4                        1       -2.2320                       1
## 5                       18       18.2868                       5
## 6                        4       -0.9967                       1
##   cate_lambda_4_ranking_20
## 1                       11
## 2                        6
## 3                       20
## 4                        1
## 5                       18
## 6                        4
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -115.96   -7.45    1.68    9.60   60.37 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -94.7101     1.4138  -66.99   <2e-16 ***
## clate_W        5.4039     2.7422    1.97    0.049 *  
## X.gender_inp   8.3672     0.7414   11.29   <2e-16 ***
## X.age_inp     -0.8173     0.0301  -27.13   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2430    138.29  <2e-16 ***
## Wu-Hausman          1 2429      1.84    0.18    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.1 on 2430 degrees of freedom
## Multiple R-Squared: 0.271,   Adjusted R-squared: 0.27 
## Wald test:  310 on 3 and 2430 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -155.30   -7.55    1.46    9.80   51.29 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -104.6726     1.1789  -88.79   <2e-16 ***
## clate_W         8.6344     3.0711    2.81    0.005 ** 
## X.gender_inp    9.3503     0.6631   14.10   <2e-16 ***
## X.age_inp      -0.5532     0.0242  -22.81   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2429    109.71  <2e-16 ***
## Wu-Hausman          1 2428      4.94   0.026 *  
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.5 on 2429 degrees of freedom
## Multiple R-Squared: 0.226,   Adjusted R-squared: 0.225 
## Wald test:  270 on 3 and 2429 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -117.32   -8.16    2.36   11.41   49.12 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -107.7594     1.4209   -75.8   <2e-16 ***
## clate_W         1.1990     2.3900     0.5     0.62    
## X.gender_inp    8.6577     0.6570    13.2   <2e-16 ***
## X.age_inp      -0.4132     0.0276   -15.0   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2429    244.05  <2e-16 ***
## Wu-Hausman          1 2428      0.67    0.41    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 17.4 on 2429 degrees of freedom
## Multiple R-Squared: 0.138,   Adjusted R-squared: 0.137 
## Wald test:  126 on 3 and 2429 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -95.32 -14.11   1.11  15.58  92.01 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -125.0018     2.1282  -58.74  < 2e-16 ***
## clate_W        20.9059     3.3343    6.27  4.3e-10 ***
## X.gender_inp    8.2034     0.9105    9.01  < 2e-16 ***
## X.age_inp      -0.2266     0.0386   -5.87  4.9e-09 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2429    204.34  <2e-16 ***
## Wu-Hausman          1 2428      7.18  0.0074 ** 
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 23.1 on 2429 degrees of freedom
## Multiple R-Squared: 0.319,   Adjusted R-squared: 0.318 
## Wald test: 87.2 on 3 and 2429 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -141.30   -9.10    1.81   10.95   88.03 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -141.6294     1.5261   -92.8   <2e-16 ***
## clate_W        77.1465     2.3417    32.9   <2e-16 ***
## X.gender_inp    7.2421     0.7174    10.1   <2e-16 ***
## X.age_inp      -0.5073     0.0286   -17.7   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2430    235.48  <2e-16 ***
## Wu-Hausman          1 2429      8.64  0.0033 ** 
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.3 on 2430 degrees of freedom
## Multiple R-Squared: 0.863,   Adjusted R-squared: 0.863 
## Wald test:  683 on 3 and 2430 DF,  p-value: <2e-16 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_sbp_neg_alpha_5_presentation_cw0_lambda_1"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_1"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12094"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12094" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12094" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      5                       5            1
## 2         8                      1                       1            2
## 3        16                      1                       1            2
## 4        17                      5                       5            1
## 5        18                      2                       2            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed Y clate_W Z weights folds   clate
## 1                  0                     0 1       0 1  1.1504     8 0.39883
## 2                  0                     0 0       0 0  0.8975     1 0.19916
## 3               1888                  1888 1       1 0  1.0000    10 0.18745
## 4                  0                     0 0       0 0  1.2126     3 0.41306
## 5               1715                  1006 1       0 0  1.0000    10 0.23865
## 6                  0                     0 0       1 1  1.0033     9 0.02548
##   clate_se clate_ranking_5 clate_ranking_20 cate_W    cate  cate_se
## 1  0.16302               5               18      1 0.09723 0.009730
## 2  0.10261               1                4      0 0.05205 0.024135
## 3  0.11559               1                3      0 0.04867 0.027492
## 4  0.05780               5               19      0 0.09769 0.019527
## 5  0.07205               2                6      0 0.07025 0.018605
## 6  0.22824               1                1      1 0.02229 0.009796
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              5              19       0.09723                       5
## 2              1               4       0.05205                       1
## 3              1               3       0.04867                       1
## 4              5              19       0.09769                       5
## 5              2               7       0.07025                       2
## 6              1               1       0.02229                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       19       0.09480                       5
## 2                        4       0.04601                       1
## 3                        3       0.04180                       1
## 4                       19       0.09281                       5
## 5                        7       0.06560                       2
## 6                        1       0.01984                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       19       0.09237                       5
## 2                        4       0.03998                       1
## 3                        3       0.03492                       1
## 4                       19       0.08793                       5
## 5                        7       0.06095                       2
## 6                        1       0.01739                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       19       0.08994                       5
## 2                        4       0.03395                       1
## 3                        3       0.02805                       1
## 4                       19       0.08304                       5
## 5                        8       0.05629                       2
## 6                        1       0.01494                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       20       0.08750                       5
## 2                        4       0.02791                       1
## 3                        3       0.02118                       1
## 4                       18       0.07816                       5
## 5                        8       0.05164                       2
## 6                        1       0.01249                       1
##   cate_lambda_4_ranking_20
## 1                       20
## 2                        3
## 3                        2
## 4                       18
## 5                        8
## 6                        1
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.739 -0.523 -0.448  0.524  1.660 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.540292   0.062812    8.60   <2e-16 ***
## clate_W       0.024653   0.118731    0.21    0.836    
## X.gender_inp -0.067606   0.026925   -2.51    0.012 *  
## X.age_inp    -0.000433   0.001178   -0.37    0.713    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415     93.36  <2e-16 ***
## Wu-Hausman          1 2414      1.69    0.19    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.563 on 2415 degrees of freedom
## Multiple R-Squared: 0.0104,  Adjusted R-squared: 0.00913 
## Wald test: 3.35 on 3 and 2415 DF,  p-value: 0.0184 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.948 -0.342 -0.239  0.416  2.442 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.251575   0.043822    5.74  1.1e-08 ***
## clate_W       0.383523   0.081614    4.70  2.8e-06 ***
## X.gender_inp -0.088315   0.023717   -3.72   0.0002 ***
## X.age_inp     0.001834   0.000838    2.19   0.0287 *  
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415    165.94  <2e-16 ***
## Wu-Hausman          1 2414      1.66     0.2    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.528 on 2415 degrees of freedom
## Multiple R-Squared: 0.0643,  Adjusted R-squared: 0.0632 
## Wald test:  8.7 on 3 and 2415 DF,  p-value: 9.66e-06 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.351 -0.336 -0.250  0.438  1.657 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.339510   0.041308    8.22  3.3e-16 ***
## clate_W       0.349964   0.079380    4.41  1.1e-05 ***
## X.gender_inp -0.077703   0.021162   -3.67  0.00025 ***
## X.age_inp    -0.000402   0.000819   -0.49  0.62354    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2414    181.04  <2e-16 ***
## Wu-Hausman          1 2413      2.27    0.13    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.529 on 2414 degrees of freedom
## Multiple R-Squared: 0.0407,  Adjusted R-squared: 0.0395 
## Wald test: 8.61 on 3 and 2414 DF,  p-value: 1.1e-05 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.378 -0.349 -0.280  0.424  1.665 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.38650    0.03958    9.77   <2e-16 ***
## clate_W       0.37210    0.08133    4.58    5e-06 ***
## X.gender_inp -0.05369    0.02045   -2.62   0.0087 ** 
## X.age_inp    -0.00128    0.00082   -1.56   0.1201    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415    180.45  <2e-16 ***
## Wu-Hausman          1 2414      1.51    0.22    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.529 on 2415 degrees of freedom
## Multiple R-Squared: 0.0582,  Adjusted R-squared: 0.0571 
## Wald test: 8.17 on 3 and 2415 DF,  p-value: 2.08e-05 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.550 -0.398 -0.298  0.611  1.537 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.386682   0.049066    7.88  4.9e-15 ***
## clate_W       0.316206   0.062533    5.06  4.6e-07 ***
## X.gender_inp -0.075347   0.020143   -3.74  0.00019 ***
## X.age_inp    -0.000268   0.000933   -0.29  0.77368    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415     329.9  <2e-16 ***
## Wu-Hausman          1 2414       0.7     0.4    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.533 on 2415 degrees of freedom
## Multiple R-Squared: 0.0602,  Adjusted R-squared: 0.059 
## Wald test: 11.2 on 3 and 2415 DF,  p-value: 2.5e-07 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_debt_neg_alpha_5_presentation_cw0_lambda_1"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_1"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12151"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12151" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12151" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      1                       1            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      2                       2            1
## 5        18                      5                       5            1
## 6        23                      3                       3            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed      Y clate_W Z weights folds
## 1                  0                     0 -48.33       0 1  1.1504     8
## 2                  0                     0 -51.33       0 0  0.8975     1
## 3               1888                  1888  -5.64       1 0  1.0000    10
## 4                  0                     0 -51.33       0 0  1.2126     3
## 5               1715                  1006 -61.02       0 0  1.0000    10
## 6                  0                     0 -31.08       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W    cate cate_se
## 1 -3.2872    3.897               1                2      1 -1.5142  1.4284
## 2 -2.8577    1.750               1                2      0 -0.6430  0.8423
## 3 65.0260    1.974               5               18      0 21.0091  4.0054
## 4  0.3029    3.198               2                8      0 -0.1304  1.1931
## 5 58.0718    3.386               5               17      0 17.8280  3.7253
## 6  1.6028    5.641               3               10      1  0.5509  0.8306
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              1               2       -1.5142                       1
## 2              2               5       -0.6430                       2
## 3              5              19       21.0091                       5
## 4              2               7       -0.1304                       2
## 5              5              18       17.8280                       5
## 6              3              11        0.5509                       3
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                        2       -1.8713                       1
## 2                        5       -0.8536                       2
## 3                       19       20.0077                       5
## 4                        7       -0.4286                       2
## 5                       18       16.8966                       5
## 6                       11        0.3433                       3
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                        2       -2.2284                       1
## 2                        5       -1.0642                       2
## 3                       19       19.0064                       5
## 4                        7       -0.7269                       2
## 5                       18       15.9653                       5
## 6                       11        0.1356                       3
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                        1        -2.585                       1
## 2                        5        -1.275                       2
## 3                       19        18.005                       5
## 4                        7        -1.025                       2
## 5                       17        15.034                       5
## 6                       12        -0.072                       3
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                        1       -2.9426                       1
## 2                        6       -1.4853                       2
## 3                       19       17.0037                       5
## 4                        7       -1.3234                       2
## 5                       17       14.1027                       5
## 6                       12       -0.2796                       3
##   cate_lambda_4_ranking_20
## 1                        1
## 2                        6
## 3                       19
## 4                        7
## 5                       17
## 6                       12
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -86.56  -8.02   1.34   9.81  65.31 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -46.40983    1.34996  -34.38  < 2e-16 ***
## clate_W       -0.68870    2.20327   -0.31     0.75    
## X.gender_inp  -4.03943    0.56450   -7.16  1.1e-12 ***
## X.age_inp      0.00719    0.02441    0.29     0.77    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2428    196.94  <2e-16 ***
## Wu-Hausman          1 2427      0.89    0.35    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.8 on 2428 degrees of freedom
## Multiple R-Squared: 0.0207,  Adjusted R-squared: 0.0195 
## Wald test: 19.2 on 3 and 2428 DF,  p-value: 2.68e-12 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -90.782  -8.151   0.729   9.203  71.464 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -43.2506     1.0820  -39.97  < 2e-16 ***
## clate_W        2.9347     2.3489    1.25  0.21164    
## X.gender_inp  -3.1162     0.5810   -5.36    9e-08 ***
## X.age_inp     -0.0897     0.0236   -3.80  0.00015 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2425    171.70  <2e-16 ***
## Wu-Hausman          1 2424      0.88    0.35    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.4 on 2425 degrees of freedom
## Multiple R-Squared: 0.016,   Adjusted R-squared: 0.0148 
## Wald test: 17.2 on 3 and 2425 DF,  p-value: 4.8e-11 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -92.36  -7.93   1.36   9.55  50.74 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -40.3838     1.3433  -30.06  < 2e-16 ***
## clate_W       -1.4980     2.3768   -0.63     0.53    
## X.gender_inp  -3.4956     0.5889   -5.94  3.3e-09 ***
## X.age_inp     -0.1248     0.0286   -4.37  1.3e-05 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2427    156.74  <2e-16 ***
## Wu-Hausman          1 2426      1.74    0.19    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.5 on 2427 degrees of freedom
## Multiple R-Squared: 0.0157,  Adjusted R-squared: 0.0145 
## Wald test: 19.6 on 3 and 2427 DF,  p-value: 1.41e-12 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -74.253 -11.517   0.693  12.699  91.870 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -53.9934     1.6447  -32.83  < 2e-16 ***
## clate_W       14.1216     2.9069    4.86  1.3e-06 ***
## X.gender_inp  -0.0479     0.8090   -0.06    0.953    
## X.age_inp     -0.0585     0.0331   -1.76    0.078 .  
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2425    166.96  <2e-16 ***
## Wu-Hausman          1 2424      6.85  0.0089 ** 
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.7 on 2425 degrees of freedom
## Multiple R-Squared: 0.237,   Adjusted R-squared: 0.236 
## Wald test: 11.7 on 3 and 2425 DF,  p-value: 1.24e-07 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -66.98  -7.84   1.32   9.78  41.38 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -74.5369     1.2865  -57.94  < 2e-16 ***
## clate_W       67.0889     1.9302   34.76  < 2e-16 ***
## X.gender_inp  -3.3768     0.5819   -5.80  7.4e-09 ***
## X.age_inp     -0.0927     0.0231   -4.01  6.3e-05 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2426       216  <2e-16 ***
## Wu-Hausman          1 2425         0    0.98    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.5 on 2426 degrees of freedom
## Multiple R-Squared: 0.86,    Adjusted R-squared: 0.86 
## Wald test:  451 on 3 and 2426 DF,  p-value: <2e-16 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_1"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_2"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12167"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12167" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12167" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      3                       3            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      1                       1            1
## 5        18                      5                       5            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed       Y clate_W Z weights folds
## 1                  0                     0 -144.00       0 1  1.1504     8
## 2                  0                     0 -134.00       0 0  0.8975     1
## 3               1888                  1888  -84.61       1 0  1.0000    10
## 4                  0                     0 -168.00       0 0  1.2126     3
## 5               1715                  1006 -160.39       0 0  1.0000    10
## 6                  0                     0  -98.00       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W     cate cate_se
## 1  3.5659    4.664               2                8      1  1.88542   1.713
## 2  3.3977    2.461               2                8      0  0.47401   1.194
## 3 86.5757    4.745               5               20      0 28.31469   3.951
## 4  0.8981    4.609               1                3      0 -0.08733   2.145
## 5 75.1033    5.278               5               18      0 20.69142   2.405
## 6  3.2103    3.311               2                8      1  0.09818   1.095
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              3              12       1.88542                       3
## 2              2               6       0.47401                       2
## 3              5              20      28.31469                       5
## 4              1               3      -0.08733                       1
## 5              5              18      20.69142                       5
## 6              1               4       0.09818                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       12        1.4572                       3
## 2                        6        0.1755                       2
## 3                       20       27.3270                       5
## 4                        3       -0.6235                       1
## 5                       18       20.0903                       5
## 6                        4       -0.1755                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       12        1.0289                       3
## 2                        6       -0.1231                       2
## 3                       20       26.3393                       5
## 4                        2       -1.1597                       1
## 5                       18       19.4891                       5
## 6                        4       -0.4493                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       11        0.6007                       3
## 2                        6       -0.4216                       2
## 3                       20       25.3516                       5
## 4                        2       -1.6958                       1
## 5                       18       18.8880                       5
## 6                        4       -0.7230                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       11        0.1724                       3
## 2                        6       -0.7201                       2
## 3                       20       24.3639                       5
## 4                        1       -2.2320                       1
## 5                       18       18.2868                       5
## 6                        4       -0.9967                       1
##   cate_lambda_4_ranking_20
## 1                       11
## 2                        6
## 3                       20
## 4                        1
## 5                       18
## 6                        4
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -116.97   -7.88    1.76   10.20   60.03 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -95.1821     1.5068  -63.17   <2e-16 ***
## clate_W        5.4245     3.0032    1.81    0.071 .  
## X.gender_inp   8.2184     0.7836   10.49   <2e-16 ***
## X.age_inp     -0.7989     0.0297  -26.94   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2430    123.85  <2e-16 ***
## Wu-Hausman          1 2429      1.69    0.19    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.7 on 2430 degrees of freedom
## Multiple R-Squared: 0.266,   Adjusted R-squared: 0.265 
## Wald test:  304 on 3 and 2430 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -155.67   -7.32    1.38    9.75   50.93 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -104.5264     1.1841  -88.28   <2e-16 ***
## clate_W         8.5654     2.7769    3.08   0.0021 ** 
## X.gender_inp    9.4821     0.6449   14.70   <2e-16 ***
## X.age_inp      -0.5545     0.0247  -22.50   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2429    140.36  <2e-16 ***
## Wu-Hausman          1 2428      5.95   0.015 *  
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.8 on 2429 degrees of freedom
## Multiple R-Squared: 0.224,   Adjusted R-squared: 0.223 
## Wald test:  266 on 3 and 2429 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -117.44   -8.12    2.00   11.04   47.14 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -108.6245     1.3184  -82.39   <2e-16 ***
## clate_W         2.1617     2.3514    0.92     0.36    
## X.gender_inp    9.0929     0.6344   14.33   <2e-16 ***
## X.age_inp      -0.3941     0.0255  -15.47   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2429    225.58  <2e-16 ***
## Wu-Hausman          1 2428      0.44    0.51    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.6 on 2429 degrees of freedom
## Multiple R-Squared: 0.167,   Adjusted R-squared: 0.166 
## Wald test:  155 on 3 and 2429 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -95.79 -14.20   1.49  15.67  74.63 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -123.4034     2.0847  -59.19  < 2e-16 ***
## clate_W        18.7725     3.4128    5.50  4.2e-08 ***
## X.gender_inp    8.0603     0.9170    8.79  < 2e-16 ***
## X.age_inp      -0.2430     0.0384   -6.33  2.8e-10 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2429     198.7  <2e-16 ***
## Wu-Hausman          1 2428      10.4  0.0013 ** 
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 23.2 on 2429 degrees of freedom
## Multiple R-Squared: 0.301,   Adjusted R-squared:  0.3 
## Wald test: 79.7 on 3 and 2429 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -140.87   -9.11    1.75   10.94   87.86 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -141.5549     1.5249   -92.8   <2e-16 ***
## clate_W        77.4206     2.3339    33.2   <2e-16 ***
## X.gender_inp    7.2460     0.7190    10.1   <2e-16 ***
## X.age_inp      -0.5118     0.0286   -17.9   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2430    237.12  <2e-16 ***
## Wu-Hausman          1 2429      8.11  0.0044 ** 
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.3 on 2430 degrees of freedom
## Multiple R-Squared: 0.863,   Adjusted R-squared: 0.863 
## Wald test:  699 on 3 and 2430 DF,  p-value: <2e-16 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_sbp_neg_alpha_5_presentation_cw0_lambda_2"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_2"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12094"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12094" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12094" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      5                       5            1
## 2         8                      1                       1            2
## 3        16                      1                       1            2
## 4        17                      5                       5            1
## 5        18                      2                       2            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed Y clate_W Z weights folds   clate
## 1                  0                     0 1       0 1  1.1504     8 0.39883
## 2                  0                     0 0       0 0  0.8975     1 0.19916
## 3               1888                  1888 1       1 0  1.0000    10 0.18745
## 4                  0                     0 0       0 0  1.2126     3 0.41306
## 5               1715                  1006 1       0 0  1.0000    10 0.23865
## 6                  0                     0 0       1 1  1.0033     9 0.02548
##   clate_se clate_ranking_5 clate_ranking_20 cate_W    cate  cate_se
## 1  0.16302               5               18      1 0.09723 0.009730
## 2  0.10261               1                4      0 0.05205 0.024135
## 3  0.11559               1                3      0 0.04867 0.027492
## 4  0.05780               5               19      0 0.09769 0.019527
## 5  0.07205               2                6      0 0.07025 0.018605
## 6  0.22824               1                1      1 0.02229 0.009796
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              5              19       0.09723                       5
## 2              1               4       0.05205                       1
## 3              1               3       0.04867                       1
## 4              5              19       0.09769                       5
## 5              2               7       0.07025                       2
## 6              1               1       0.02229                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       19       0.09480                       5
## 2                        4       0.04601                       1
## 3                        3       0.04180                       1
## 4                       19       0.09281                       5
## 5                        7       0.06560                       2
## 6                        1       0.01984                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       19       0.09237                       5
## 2                        4       0.03998                       1
## 3                        3       0.03492                       1
## 4                       19       0.08793                       5
## 5                        7       0.06095                       2
## 6                        1       0.01739                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       19       0.08994                       5
## 2                        4       0.03395                       1
## 3                        3       0.02805                       1
## 4                       19       0.08304                       5
## 5                        8       0.05629                       2
## 6                        1       0.01494                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       20       0.08750                       5
## 2                        4       0.02791                       1
## 3                        3       0.02118                       1
## 4                       18       0.07816                       5
## 5                        8       0.05164                       2
## 6                        1       0.01249                       1
##   cate_lambda_4_ranking_20
## 1                       20
## 2                        3
## 3                        2
## 4                       18
## 5                        8
## 6                        1
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.711 -0.519 -0.445  0.518  1.680 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   5.21e-01   6.22e-02    8.37   <2e-16 ***
## clate_W       5.60e-02   1.18e-01    0.48   0.6347    
## X.gender_inp -7.24e-02   2.67e-02   -2.71   0.0068 ** 
## X.age_inp    -5.26e-05   1.16e-03   -0.05   0.9638    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415     94.08  <2e-16 ***
## Wu-Hausman          1 2414      1.03    0.31    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.561 on 2415 degrees of freedom
## Multiple R-Squared: 0.0168,  Adjusted R-squared: 0.0155 
## Wald test: 3.42 on 3 and 2415 DF,  p-value: 0.0166 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.868 -0.359 -0.278  0.457  2.322 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.294334   0.043713    6.73  2.1e-11 ***
## clate_W       0.311124   0.079001    3.94  8.4e-05 ***
## X.gender_inp -0.064806   0.022940   -2.82   0.0048 ** 
## X.age_inp     0.001081   0.000843    1.28   0.1998    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415    179.37  <2e-16 ***
## Wu-Hausman          1 2414      0.25    0.62    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.528 on 2415 degrees of freedom
## Multiple R-Squared: 0.0662,  Adjusted R-squared: 0.065 
## Wald test: 5.62 on 3 and 2415 DF,  p-value: 0.000776 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.361 -0.339 -0.236  0.442  1.701 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.336942   0.040874    8.24  2.7e-16 ***
## clate_W       0.352965   0.081123    4.35  1.4e-05 ***
## X.gender_inp -0.092912   0.021516   -4.32  1.6e-05 ***
## X.age_inp    -0.000264   0.000818   -0.32     0.75    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2414     167.9  <2e-16 ***
## Wu-Hausman          1 2413       2.1    0.15    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.526 on 2414 degrees of freedom
## Multiple R-Squared: 0.0451,  Adjusted R-squared: 0.0439 
## Wald test: 9.39 on 3 and 2414 DF,  p-value: 3.61e-06 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.387 -0.345 -0.275  0.415  1.443 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.387683   0.039537    9.81  < 2e-16 ***
## clate_W       0.384108   0.079540    4.83  1.5e-06 ***
## X.gender_inp -0.052266   0.020283   -2.58    0.010 *  
## X.age_inp    -0.001430   0.000805   -1.77    0.076 .  
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415    188.84  <2e-16 ***
## Wu-Hausman          1 2414      1.83    0.18    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.529 on 2415 degrees of freedom
## Multiple R-Squared: 0.0596,  Adjusted R-squared: 0.0584 
## Wald test: 9.13 on 3 and 2415 DF,  p-value: 5.25e-06 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.563 -0.394 -0.299  0.616  1.557 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.364041   0.049103    7.41  1.7e-13 ***
## clate_W       0.335019   0.063601    5.27  1.5e-07 ***
## X.gender_inp -0.071594   0.020127   -3.56  0.00038 ***
## X.age_inp     0.000125   0.000940    0.13  0.89418    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415    321.77  <2e-16 ***
## Wu-Hausman          1 2414      1.18    0.28    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.533 on 2415 degrees of freedom
## Multiple R-Squared: 0.0588,  Adjusted R-squared: 0.0577 
## Wald test: 11.4 on 3 and 2415 DF,  p-value: 2.04e-07 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_debt_neg_alpha_5_presentation_cw0_lambda_2"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_2"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12151"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12151" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12151" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      1                       1            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      2                       2            1
## 5        18                      5                       5            1
## 6        23                      3                       3            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed      Y clate_W Z weights folds
## 1                  0                     0 -48.33       0 1  1.1504     8
## 2                  0                     0 -51.33       0 0  0.8975     1
## 3               1888                  1888  -5.64       1 0  1.0000    10
## 4                  0                     0 -51.33       0 0  1.2126     3
## 5               1715                  1006 -61.02       0 0  1.0000    10
## 6                  0                     0 -31.08       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W    cate cate_se
## 1 -3.2872    3.897               1                2      1 -1.5142  1.4284
## 2 -2.8577    1.750               1                2      0 -0.6430  0.8423
## 3 65.0260    1.974               5               18      0 21.0091  4.0054
## 4  0.3029    3.198               2                8      0 -0.1304  1.1931
## 5 58.0718    3.386               5               17      0 17.8280  3.7253
## 6  1.6028    5.641               3               10      1  0.5509  0.8306
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              1               2       -1.5142                       1
## 2              2               5       -0.6430                       2
## 3              5              19       21.0091                       5
## 4              2               7       -0.1304                       2
## 5              5              18       17.8280                       5
## 6              3              11        0.5509                       3
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                        2       -1.8713                       1
## 2                        5       -0.8536                       2
## 3                       19       20.0077                       5
## 4                        7       -0.4286                       2
## 5                       18       16.8966                       5
## 6                       11        0.3433                       3
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                        2       -2.2284                       1
## 2                        5       -1.0642                       2
## 3                       19       19.0064                       5
## 4                        7       -0.7269                       2
## 5                       18       15.9653                       5
## 6                       11        0.1356                       3
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                        1        -2.585                       1
## 2                        5        -1.275                       2
## 3                       19        18.005                       5
## 4                        7        -1.025                       2
## 5                       17        15.034                       5
## 6                       12        -0.072                       3
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                        1       -2.9426                       1
## 2                        6       -1.4853                       2
## 3                       19       17.0037                       5
## 4                        7       -1.3234                       2
## 5                       17       14.1027                       5
## 6                       12       -0.2796                       3
##   cate_lambda_4_ranking_20
## 1                        1
## 2                        6
## 3                       19
## 4                        7
## 5                       17
## 6                       12
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -86.85  -7.94   1.14   9.81  72.50 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -46.8458     1.3535  -34.61   <2e-16 ***
## clate_W       -0.2472     2.2006   -0.11     0.91    
## X.gender_inp  -3.7313     0.5652   -6.60    5e-11 ***
## X.age_inp      0.0125     0.0248    0.50     0.62    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2427    200.09  <2e-16 ***
## Wu-Hausman          1 2426      0.36    0.55    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.8 on 2427 degrees of freedom
## Multiple R-Squared: 0.0187,  Adjusted R-squared: 0.0175 
## Wald test: 15.9 on 3 and 2427 DF,  p-value: 3.06e-10 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -90.494  -8.163   0.952   9.264  59.163 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -43.2279     1.0709  -40.37  < 2e-16 ***
## clate_W        3.0303     2.3567    1.29      0.2    
## X.gender_inp  -3.3050     0.5720   -5.78  8.6e-09 ***
## X.age_inp     -0.0912     0.0234   -3.90  9.9e-05 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2426     169.2  <2e-16 ***
## Wu-Hausman          1 2425       0.7     0.4    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.3 on 2426 degrees of freedom
## Multiple R-Squared: 0.0197,  Adjusted R-squared: 0.0185 
## Wald test:   19 on 3 and 2426 DF,  p-value: 3.57e-12 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -92.43  -8.16   1.19   9.45  51.13 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -40.2637     1.3769  -29.24  < 2e-16 ***
## clate_W       -1.9105     2.3777   -0.80     0.42    
## X.gender_inp  -3.5843     0.5974   -6.00  2.3e-09 ***
## X.age_inp     -0.1232     0.0292   -4.22  2.5e-05 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2426    153.35  <2e-16 ***
## Wu-Hausman          1 2425      2.29    0.13    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.5 on 2426 degrees of freedom
## Multiple R-Squared: 0.0132,  Adjusted R-squared: 0.012 
## Wald test: 20.5 on 3 and 2426 DF,  p-value: 3.81e-13 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -101.037  -11.383    0.742   12.777   92.928 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -52.8035     1.6340  -32.32  < 2e-16 ***
## clate_W       13.5868     2.9096    4.67  3.2e-06 ***
## X.gender_inp  -0.0925     0.8080   -0.11     0.91    
## X.age_inp     -0.0852     0.0332   -2.57     0.01 *  
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2426    169.95  <2e-16 ***
## Wu-Hausman          1 2425      8.01  0.0047 ** 
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.9 on 2426 degrees of freedom
## Multiple R-Squared: 0.231,   Adjusted R-squared: 0.23 
## Wald test: 11.8 on 3 and 2426 DF,  p-value: 1.1e-07 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -67.26  -7.93   1.28   9.76  46.61 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -74.5878     1.2862  -57.99  < 2e-16 ***
## clate_W       67.2576     1.9263   34.91  < 2e-16 ***
## X.gender_inp  -3.2871     0.5831   -5.64  1.9e-08 ***
## X.age_inp     -0.0940     0.0232   -4.05  5.3e-05 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2426    217.38  <2e-16 ***
## Wu-Hausman          1 2425      0.01    0.93    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.5 on 2426 degrees of freedom
## Multiple R-Squared: 0.86,    Adjusted R-squared: 0.86 
## Wald test:  456 on 3 and 2426 DF,  p-value: <2e-16 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_2"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_3"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12167"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12167" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12167" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      3                       3            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      1                       1            1
## 5        18                      5                       5            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed       Y clate_W Z weights folds
## 1                  0                     0 -144.00       0 1  1.1504     8
## 2                  0                     0 -134.00       0 0  0.8975     1
## 3               1888                  1888  -84.61       1 0  1.0000    10
## 4                  0                     0 -168.00       0 0  1.2126     3
## 5               1715                  1006 -160.39       0 0  1.0000    10
## 6                  0                     0  -98.00       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W     cate cate_se
## 1  3.5659    4.664               2                8      1  1.88542   1.713
## 2  3.3977    2.461               2                8      0  0.47401   1.194
## 3 86.5757    4.745               5               20      0 28.31469   3.951
## 4  0.8981    4.609               1                3      0 -0.08733   2.145
## 5 75.1033    5.278               5               18      0 20.69142   2.405
## 6  3.2103    3.311               2                8      1  0.09818   1.095
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              3              12       1.88542                       3
## 2              2               6       0.47401                       2
## 3              5              20      28.31469                       5
## 4              1               3      -0.08733                       1
## 5              5              18      20.69142                       5
## 6              1               4       0.09818                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       12        1.4572                       3
## 2                        6        0.1755                       2
## 3                       20       27.3270                       5
## 4                        3       -0.6235                       1
## 5                       18       20.0903                       5
## 6                        4       -0.1755                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       12        1.0289                       3
## 2                        6       -0.1231                       2
## 3                       20       26.3393                       5
## 4                        2       -1.1597                       1
## 5                       18       19.4891                       5
## 6                        4       -0.4493                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       11        0.6007                       3
## 2                        6       -0.4216                       2
## 3                       20       25.3516                       5
## 4                        2       -1.6958                       1
## 5                       18       18.8880                       5
## 6                        4       -0.7230                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       11        0.1724                       3
## 2                        6       -0.7201                       2
## 3                       20       24.3639                       5
## 4                        1       -2.2320                       1
## 5                       18       18.2868                       5
## 6                        4       -0.9967                       1
##   cate_lambda_4_ranking_20
## 1                       11
## 2                        6
## 3                       20
## 4                        1
## 5                       18
## 6                        4
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -116.18   -7.83    1.89   10.52   60.88 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -95.6011     1.5513  -61.62   <2e-16 ***
## clate_W        6.4285     2.9952    2.15    0.032 *  
## X.gender_inp   7.6250     0.8056    9.47   <2e-16 ***
## X.age_inp     -0.7865     0.0296  -26.62   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2430    134.14  <2e-16 ***
## Wu-Hausman          1 2429      2.18    0.14    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 17.3 on 2430 degrees of freedom
## Multiple R-Squared: 0.259,   Adjusted R-squared: 0.258 
## Wald test:  294 on 3 and 2430 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -157.45   -7.48    1.28    9.71   48.94 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -104.7446     1.2187   -86.0   <2e-16 ***
## clate_W         7.1743     2.7584     2.6   0.0094 ** 
## X.gender_inp   10.0727     0.6337    15.9   <2e-16 ***
## X.age_inp      -0.5391     0.0246   -21.9   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2429    138.14  <2e-16 ***
## Wu-Hausman          1 2428      4.02   0.045 *  
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.6 on 2429 degrees of freedom
## Multiple R-Squared: 0.237,   Adjusted R-squared: 0.236 
## Wald test:  274 on 3 and 2429 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -117.17   -7.83    1.76   10.67   47.08 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -108.5960     1.2734  -85.28   <2e-16 ***
## clate_W         2.9262     2.4586    1.19     0.23    
## X.gender_inp    9.3414     0.6272   14.89   <2e-16 ***
## X.age_inp      -0.3982     0.0246  -16.16   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2429    196.77  <2e-16 ***
## Wu-Hausman          1 2428      0.08    0.78    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.3 on 2429 degrees of freedom
## Multiple R-Squared: 0.188,   Adjusted R-squared: 0.187 
## Wald test:  179 on 3 and 2429 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -96.10 -14.11   1.68  15.71  76.01 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -122.2330     1.9921  -61.36  < 2e-16 ***
## clate_W        17.1155     3.2695    5.23  1.8e-07 ***
## X.gender_inp    7.7953     0.9198    8.48  < 2e-16 ***
## X.age_inp      -0.2530     0.0378   -6.70  2.6e-11 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2429     218.8 < 2e-16 ***
## Wu-Hausman          1 2428      14.3 0.00016 ***
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 23.3 on 2429 degrees of freedom
## Multiple R-Squared: 0.286,   Adjusted R-squared: 0.285 
## Wald test: 74.4 on 3 and 2429 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -140.80   -9.10    1.67   10.95   87.46 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -141.6926     1.5246   -92.9   <2e-16 ***
## clate_W        77.6114     2.3291    33.3   <2e-16 ***
## X.gender_inp    7.2181     0.7177    10.1   <2e-16 ***
## X.age_inp      -0.5097     0.0285   -17.9   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2430    235.83  <2e-16 ***
## Wu-Hausman          1 2429      7.88   0.005 ** 
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.2 on 2430 degrees of freedom
## Multiple R-Squared: 0.865,   Adjusted R-squared: 0.865 
## Wald test:  713 on 3 and 2430 DF,  p-value: <2e-16 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_sbp_neg_alpha_5_presentation_cw0_lambda_3"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_3"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12094"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12094" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12094" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      5                       5            1
## 2         8                      1                       1            2
## 3        16                      1                       1            2
## 4        17                      5                       5            1
## 5        18                      2                       2            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed Y clate_W Z weights folds   clate
## 1                  0                     0 1       0 1  1.1504     8 0.39883
## 2                  0                     0 0       0 0  0.8975     1 0.19916
## 3               1888                  1888 1       1 0  1.0000    10 0.18745
## 4                  0                     0 0       0 0  1.2126     3 0.41306
## 5               1715                  1006 1       0 0  1.0000    10 0.23865
## 6                  0                     0 0       1 1  1.0033     9 0.02548
##   clate_se clate_ranking_5 clate_ranking_20 cate_W    cate  cate_se
## 1  0.16302               5               18      1 0.09723 0.009730
## 2  0.10261               1                4      0 0.05205 0.024135
## 3  0.11559               1                3      0 0.04867 0.027492
## 4  0.05780               5               19      0 0.09769 0.019527
## 5  0.07205               2                6      0 0.07025 0.018605
## 6  0.22824               1                1      1 0.02229 0.009796
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              5              19       0.09723                       5
## 2              1               4       0.05205                       1
## 3              1               3       0.04867                       1
## 4              5              19       0.09769                       5
## 5              2               7       0.07025                       2
## 6              1               1       0.02229                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       19       0.09480                       5
## 2                        4       0.04601                       1
## 3                        3       0.04180                       1
## 4                       19       0.09281                       5
## 5                        7       0.06560                       2
## 6                        1       0.01984                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       19       0.09237                       5
## 2                        4       0.03998                       1
## 3                        3       0.03492                       1
## 4                       19       0.08793                       5
## 5                        7       0.06095                       2
## 6                        1       0.01739                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       19       0.08994                       5
## 2                        4       0.03395                       1
## 3                        3       0.02805                       1
## 4                       19       0.08304                       5
## 5                        8       0.05629                       2
## 6                        1       0.01494                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       20       0.08750                       5
## 2                        4       0.02791                       1
## 3                        3       0.02118                       1
## 4                       18       0.07816                       5
## 5                        8       0.05164                       2
## 6                        1       0.01249                       1
##   cate_lambda_4_ranking_20
## 1                       20
## 2                        3
## 3                        2
## 4                       18
## 5                        8
## 6                        1
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.706 -0.518 -0.446  0.518  1.668 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   5.17e-01   6.12e-02    8.43   <2e-16 ***
## clate_W       5.74e-02   1.20e-01    0.48    0.631    
## X.gender_inp -6.84e-02   2.67e-02   -2.56    0.011 *  
## X.age_inp     3.12e-05   1.12e-03    0.03    0.978    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415     90.40  <2e-16 ***
## Wu-Hausman          1 2414      1.15    0.28    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.561 on 2415 degrees of freedom
## Multiple R-Squared: 0.0175,  Adjusted R-squared: 0.0163 
## Wald test: 3.01 on 3 and 2415 DF,  p-value: 0.0291 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.791 -0.371 -0.286  0.486  2.298 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.316665   0.043959    7.20  7.8e-13 ***
## clate_W       0.276495   0.079378    3.48   0.0005 ***
## X.gender_inp -0.069860   0.022529   -3.10   0.0020 ** 
## X.age_inp     0.000828   0.000839    0.99   0.3234    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415    178.12  <2e-16 ***
## Wu-Hausman          1 2414      0.02    0.89    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.527 on 2415 degrees of freedom
## Multiple R-Squared: 0.0641,  Adjusted R-squared: 0.063 
## Wald test: 4.98 on 3 and 2415 DF,  p-value: 0.00191 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.268 -0.339 -0.232  0.435  2.083 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   3.21e-01   4.06e-02    7.90  4.3e-15 ***
## clate_W       3.62e-01   8.10e-02    4.47  8.3e-06 ***
## X.gender_inp -8.65e-02   2.21e-02   -3.91  9.5e-05 ***
## X.age_inp    -7.33e-05   8.19e-04   -0.09     0.93    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2414    169.80  <2e-16 ***
## Wu-Hausman          1 2413      2.56    0.11    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.527 on 2414 degrees of freedom
## Multiple R-Squared: 0.0399,  Adjusted R-squared: 0.0387 
## Wald test: 8.44 on 3 and 2414 DF,  p-value: 1.4e-05 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.505 -0.331 -0.261  0.386  1.465 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.363601   0.039809    9.13  < 2e-16 ***
## clate_W       0.427497   0.077723    5.50  4.2e-08 ***
## X.gender_inp -0.056811   0.020283   -2.80   0.0051 ** 
## X.age_inp    -0.001140   0.000807   -1.41   0.1578    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2416    199.19  <2e-16 ***
## Wu-Hausman          1 2415      4.06   0.044 *  
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.533 on 2416 degrees of freedom
## Multiple R-Squared: 0.0489,  Adjusted R-squared: 0.0477 
## Wald test: 11.4 on 3 and 2416 DF,  p-value: 1.98e-07 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.563 -0.400 -0.313  0.610  1.485 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.406858   0.048469    8.39  < 2e-16 ***
## clate_W       0.310488   0.064039    4.85  1.3e-06 ***
## X.gender_inp -0.063633   0.020059   -3.17   0.0015 ** 
## X.age_inp    -0.000612   0.000930   -0.66   0.5104    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2414     316.5  <2e-16 ***
## Wu-Hausman          1 2413       0.4    0.53    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.533 on 2414 degrees of freedom
## Multiple R-Squared: 0.0617,  Adjusted R-squared: 0.0605 
## Wald test: 9.73 on 3 and 2414 DF,  p-value: 2.22e-06 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_debt_neg_alpha_5_presentation_cw0_lambda_3"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_3"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12151"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12151" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12151" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      1                       1            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      2                       2            1
## 5        18                      5                       5            1
## 6        23                      3                       3            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed      Y clate_W Z weights folds
## 1                  0                     0 -48.33       0 1  1.1504     8
## 2                  0                     0 -51.33       0 0  0.8975     1
## 3               1888                  1888  -5.64       1 0  1.0000    10
## 4                  0                     0 -51.33       0 0  1.2126     3
## 5               1715                  1006 -61.02       0 0  1.0000    10
## 6                  0                     0 -31.08       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W    cate cate_se
## 1 -3.2872    3.897               1                2      1 -1.5142  1.4284
## 2 -2.8577    1.750               1                2      0 -0.6430  0.8423
## 3 65.0260    1.974               5               18      0 21.0091  4.0054
## 4  0.3029    3.198               2                8      0 -0.1304  1.1931
## 5 58.0718    3.386               5               17      0 17.8280  3.7253
## 6  1.6028    5.641               3               10      1  0.5509  0.8306
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              1               2       -1.5142                       1
## 2              2               5       -0.6430                       2
## 3              5              19       21.0091                       5
## 4              2               7       -0.1304                       2
## 5              5              18       17.8280                       5
## 6              3              11        0.5509                       3
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                        2       -1.8713                       1
## 2                        5       -0.8536                       2
## 3                       19       20.0077                       5
## 4                        7       -0.4286                       2
## 5                       18       16.8966                       5
## 6                       11        0.3433                       3
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                        2       -2.2284                       1
## 2                        5       -1.0642                       2
## 3                       19       19.0064                       5
## 4                        7       -0.7269                       2
## 5                       18       15.9653                       5
## 6                       11        0.1356                       3
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                        1        -2.585                       1
## 2                        5        -1.275                       2
## 3                       19        18.005                       5
## 4                        7        -1.025                       2
## 5                       17        15.034                       5
## 6                       12        -0.072                       3
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                        1       -2.9426                       1
## 2                        6       -1.4853                       2
## 3                       19       17.0037                       5
## 4                        7       -1.3234                       2
## 5                       17       14.1027                       5
## 6                       12       -0.2796                       3
##   cate_lambda_4_ranking_20
## 1                        1
## 2                        6
## 3                       19
## 4                        7
## 5                       17
## 6                       12
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -86.84  -7.95   1.21   9.90  72.46 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -46.8145     1.3750  -34.05  < 2e-16 ***
## clate_W        0.0332     2.1575    0.02     0.99    
## X.gender_inp  -3.7038     0.5630   -6.58  5.8e-11 ***
## X.age_inp      0.0113     0.0253    0.45     0.66    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2427    211.86  <2e-16 ***
## Wu-Hausman          1 2426      0.25    0.62    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.9 on 2427 degrees of freedom
## Multiple R-Squared: 0.0187,  Adjusted R-squared: 0.0175 
## Wald test: 15.4 on 3 and 2427 DF,  p-value: 6.57e-10 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -90.024  -8.140   0.773   9.079  58.455 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -43.4778     1.0523  -41.32  < 2e-16 ***
## clate_W        2.3819     2.2834    1.04  0.29698    
## X.gender_inp  -3.6288     0.5701   -6.36  2.3e-10 ***
## X.age_inp     -0.0808     0.0232   -3.48  0.00051 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2426    176.33  <2e-16 ***
## Wu-Hausman          1 2425      0.39    0.53    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.2 on 2426 degrees of freedom
## Multiple R-Squared: 0.0236,  Adjusted R-squared: 0.0224 
## Wald test: 20.8 on 3 and 2426 DF,  p-value: 2.82e-13 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -92.66  -7.98   1.23   9.36  51.63 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -40.3513     1.3748  -29.35  < 2e-16 ***
## clate_W       -1.8079     2.5101   -0.72     0.47    
## X.gender_inp  -3.1382     0.6174   -5.08  4.0e-07 ***
## X.age_inp     -0.1283     0.0292   -4.39  1.2e-05 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2426    139.36  <2e-16 ***
## Wu-Hausman          1 2425      2.01    0.16    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.5 on 2426 degrees of freedom
## Multiple R-Squared: 0.01,    Adjusted R-squared: 0.00882 
## Wald test: 17.3 on 3 and 2426 DF,  p-value: 4.16e-11 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -100.503  -11.319    0.704   12.960   92.800 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -52.1847     1.6397  -31.83  < 2e-16 ***
## clate_W       13.4001     2.9188    4.59  4.6e-06 ***
## X.gender_inp  -0.4114     0.8033   -0.51   0.6086    
## X.age_inp     -0.0941     0.0332   -2.84   0.0046 ** 
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2426    167.44  <2e-16 ***
## Wu-Hausman          1 2425      8.15  0.0043 ** 
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.9 on 2426 degrees of freedom
## Multiple R-Squared: 0.23,    Adjusted R-squared: 0.229 
## Wald test: 11.5 on 3 and 2426 DF,  p-value: 1.78e-07 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -67.58  -7.93   1.28   9.79  46.73 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -74.5432     1.2811  -58.19  < 2e-16 ***
## clate_W       67.5392     1.9220   35.14  < 2e-16 ***
## X.gender_inp  -3.3061     0.5824   -5.68  1.5e-08 ***
## X.age_inp     -0.0967     0.0231   -4.18  3.0e-05 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2426    217.83  <2e-16 ***
## Wu-Hausman          1 2425      0.04    0.84    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.5 on 2426 degrees of freedom
## Multiple R-Squared: 0.861,   Adjusted R-squared: 0.86 
## Wald test:  463 on 3 and 2426 DF,  p-value: <2e-16 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_3"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_sbp_neg_alpha_5_presentation_cw0_lambda_4"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_sbp_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,167
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -144.00, -134.00, -84.61, -168.00, -160.39, -…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 3.5659, 3.3977, 86.5757, 0.8981, 75.1033, 3.2…
## $ clate_se                 <dbl> 4.664, 2.461, 4.745, 4.609, 5.278, 3.311, 3.8…
## $ clate_ranking_5          <int> 2, 2, 5, 1, 5, 2, 2, 5, 2, 2, 1, 3, 4, 3, 1, …
## $ clate_ranking_20         <int> 8, 8, 20, 3, 18, 8, 6, 17, 6, 8, 1, 12, 16, 9…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_se                  <dbl> 1.7130, 1.1941, 3.9508, 2.1447, 2.4046, 1.094…
## $ cate_ranking_5           <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_ranking_20          <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_0            <dbl> 1.88542, 0.47401, 28.31469, -0.08733, 20.6914…
## $ cate_lambda_0_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_0_ranking_20 <int> 12, 6, 20, 3, 18, 4, 3, 18, 11, 9, 1, 13, 18,…
## $ cate_lambda_1            <dbl> 1.4572, 0.1755, 27.3270, -0.6235, 20.0903, -0…
## $ cate_lambda_1_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 3, 2, …
## $ cate_lambda_1_ranking_20 <int> 12, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 13, 17,…
## $ cate_lambda_2            <dbl> 1.02891, -0.12306, 26.33931, -1.15968, 19.489…
## $ cate_lambda_2_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 3, 1, 4, 5, 2, 2, …
## $ cate_lambda_2_ranking_20 <int> 11, 6, 20, 2, 18, 4, 3, 18, 11, 9, 1, 14, 17,…
## $ cate_lambda_3            <dbl> 0.600652, -0.421592, 25.351623, -1.695847, 18…
## $ cate_lambda_3_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_3_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 8, 1, 14, 17,…
## $ cate_lambda_4            <dbl> 0.17239, -0.72012, 24.36394, -2.23202, 18.286…
## $ cate_lambda_4_ranking_5  <int> 3, 2, 5, 1, 5, 1, 1, 5, 3, 2, 1, 4, 5, 2, 2, …
## $ cate_lambda_4_ranking_20 <int> 11, 6, 20, 1, 18, 4, 4, 18, 11, 7, 1, 14, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12167"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12167" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12167" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      3                       3            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      1                       1            1
## 5        18                      5                       5            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed       Y clate_W Z weights folds
## 1                  0                     0 -144.00       0 1  1.1504     8
## 2                  0                     0 -134.00       0 0  0.8975     1
## 3               1888                  1888  -84.61       1 0  1.0000    10
## 4                  0                     0 -168.00       0 0  1.2126     3
## 5               1715                  1006 -160.39       0 0  1.0000    10
## 6                  0                     0  -98.00       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W     cate cate_se
## 1  3.5659    4.664               2                8      1  1.88542   1.713
## 2  3.3977    2.461               2                8      0  0.47401   1.194
## 3 86.5757    4.745               5               20      0 28.31469   3.951
## 4  0.8981    4.609               1                3      0 -0.08733   2.145
## 5 75.1033    5.278               5               18      0 20.69142   2.405
## 6  3.2103    3.311               2                8      1  0.09818   1.095
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              3              12       1.88542                       3
## 2              2               6       0.47401                       2
## 3              5              20      28.31469                       5
## 4              1               3      -0.08733                       1
## 5              5              18      20.69142                       5
## 6              1               4       0.09818                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       12        1.4572                       3
## 2                        6        0.1755                       2
## 3                       20       27.3270                       5
## 4                        3       -0.6235                       1
## 5                       18       20.0903                       5
## 6                        4       -0.1755                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       12        1.0289                       3
## 2                        6       -0.1231                       2
## 3                       20       26.3393                       5
## 4                        2       -1.1597                       1
## 5                       18       19.4891                       5
## 6                        4       -0.4493                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       11        0.6007                       3
## 2                        6       -0.4216                       2
## 3                       20       25.3516                       5
## 4                        2       -1.6958                       1
## 5                       18       18.8880                       5
## 6                        4       -0.7230                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       11        0.1724                       3
## 2                        6       -0.7201                       2
## 3                       20       24.3639                       5
## 4                        1       -2.2320                       1
## 5                       18       18.2868                       5
## 6                        4       -0.9967                       1
##   cate_lambda_4_ranking_20
## 1                       11
## 2                        6
## 3                       20
## 4                        1
## 5                       18
## 6                        4
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -117.20   -8.27    2.05   10.98   62.21 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -96.4482     1.6240  -59.39   <2e-16 ***
## clate_W        6.8383     3.0278    2.26    0.024 *  
## X.gender_inp   7.7805     0.8287    9.39   <2e-16 ***
## X.age_inp     -0.7668     0.0298  -25.76   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2430    142.22  <2e-16 ***
## Wu-Hausman          1 2429      2.52    0.11    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18 on 2430 degrees of freedom
## Multiple R-Squared: 0.248,   Adjusted R-squared: 0.247 
## Wald test:  280 on 3 and 2430 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -157.74   -7.72    1.23    9.71   48.58 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -105.0146     1.2579  -83.48   <2e-16 ***
## clate_W         7.0509     2.7609    2.55    0.011 *  
## X.gender_inp   10.0737     0.6425   15.68   <2e-16 ***
## X.age_inp      -0.5292     0.0247  -21.45   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2429    134.37  <2e-16 ***
## Wu-Hausman          1 2428      4.03   0.045 *  
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.4 on 2429 degrees of freedom
## Multiple R-Squared: 0.244,   Adjusted R-squared: 0.243 
## Wald test:  285 on 3 and 2429 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -118.02   -7.61    1.68   10.59   45.96 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -108.5950     1.2243  -88.70   <2e-16 ***
## clate_W         1.9301     2.4483    0.79     0.43    
## X.gender_inp    9.6060     0.6178   15.55   <2e-16 ***
## X.age_inp      -0.3870     0.0241  -16.04   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2429    189.76  <2e-16 ***
## Wu-Hausman          1 2428      0.55    0.46    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16 on 2429 degrees of freedom
## Multiple R-Squared: 0.196,   Adjusted R-squared: 0.195 
## Wald test:  190 on 3 and 2429 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
##  -95.8  -13.8    1.5   15.5   75.8 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -120.9649     1.9397  -62.36  < 2e-16 ***
## clate_W        16.8535     3.2764    5.14  2.9e-07 ***
## X.gender_inp    7.5349     0.9183    8.21  3.7e-16 ***
## X.age_inp      -0.2747     0.0372   -7.38  2.2e-13 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2429     216.2 < 2e-16 ***
## Wu-Hausman          1 2428      14.9 0.00012 ***
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 23.1 on 2429 degrees of freedom
## Multiple R-Squared: 0.286,   Adjusted R-squared: 0.285 
## Wald test: 74.8 on 3 and 2429 DF,  p-value: <2e-16 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -141.07   -9.15    1.63   10.89   87.63 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -141.6350     1.5195   -93.2   <2e-16 ***
## clate_W        77.4209     2.3251    33.3   <2e-16 ***
## X.gender_inp    7.3079     0.7183    10.2   <2e-16 ***
## X.age_inp      -0.5100     0.0286   -17.9   <2e-16 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2430    237.87  <2e-16 ***
## Wu-Hausman          1 2429      8.55  0.0035 ** 
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.2 on 2430 degrees of freedom
## Multiple R-Squared: 0.864,   Adjusted R-squared: 0.864 
## Wald test:  704 on 3 and 2430 DF,  p-value: <2e-16 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_sbp_neg_alpha_5_presentation_cw0_lambda_4"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_debt_neg_alpha_5_presentation_cw0_lambda_4"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_debt_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,094
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <int> 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, …
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> 0.39883, 0.19916, 0.18745, 0.41306, 0.23865, …
## $ clate_se                 <dbl> 0.16302, 0.10261, 0.11559, 0.05780, 0.07205, …
## $ clate_ranking_5          <int> 5, 1, 1, 5, 2, 1, 1, 2, 2, 3, 4, 4, 2, 4, 2, …
## $ clate_ranking_20         <int> 18, 4, 3, 19, 6, 1, 1, 5, 7, 10, 14, 14, 8, 1…
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_se                  <dbl> 0.009730, 0.024135, 0.027492, 0.019527, 0.018…
## $ cate_ranking_5           <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_ranking_20          <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_0            <dbl> 0.09723, 0.05205, 0.04867, 0.09769, 0.07025, …
## $ cate_lambda_0_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_0_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 14, 9, 15, 17, 8, 1…
## $ cate_lambda_1            <dbl> 0.09480, 0.04601, 0.04180, 0.09281, 0.06560, …
## $ cate_lambda_1_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 5, 2, 5, 4, …
## $ cate_lambda_1_ranking_20 <int> 19, 4, 3, 19, 7, 1, 1, 7, 15, 9, 15, 17, 8, 1…
## $ cate_lambda_2            <dbl> 0.092368, 0.039981, 0.034923, 0.087925, 0.060…
## $ cate_lambda_2_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 4, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_2_ranking_20 <int> 19, 4, 3, 19, 8, 1, 1, 7, 16, 10, 16, 15, 8, …
## $ cate_lambda_3            <dbl> 0.089936, 0.033947, 0.028050, 0.083043, 0.056…
## $ cate_lambda_3_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 4, 4, 2, 5, 4, …
## $ cate_lambda_3_ranking_20 <int> 20, 4, 3, 18, 8, 1, 1, 7, 17, 11, 16, 14, 8, …
## $ cate_lambda_4            <dbl> 0.087503, 0.027914, 0.021177, 0.078162, 0.051…
## $ cate_lambda_4_ranking_5  <int> 5, 1, 1, 5, 2, 1, 1, 2, 5, 3, 5, 4, 2, 5, 4, …
## $ cate_lambda_4_ranking_20 <int> 20, 3, 2, 18, 8, 1, 1, 7, 17, 11, 17, 14, 8, …
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12094"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12094" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12094" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      5                       5            1
## 2         8                      1                       1            2
## 3        16                      1                       1            2
## 4        17                      5                       5            1
## 5        18                      2                       2            1
## 6        23                      1                       1            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed Y clate_W Z weights folds   clate
## 1                  0                     0 1       0 1  1.1504     8 0.39883
## 2                  0                     0 0       0 0  0.8975     1 0.19916
## 3               1888                  1888 1       1 0  1.0000    10 0.18745
## 4                  0                     0 0       0 0  1.2126     3 0.41306
## 5               1715                  1006 1       0 0  1.0000    10 0.23865
## 6                  0                     0 0       1 1  1.0033     9 0.02548
##   clate_se clate_ranking_5 clate_ranking_20 cate_W    cate  cate_se
## 1  0.16302               5               18      1 0.09723 0.009730
## 2  0.10261               1                4      0 0.05205 0.024135
## 3  0.11559               1                3      0 0.04867 0.027492
## 4  0.05780               5               19      0 0.09769 0.019527
## 5  0.07205               2                6      0 0.07025 0.018605
## 6  0.22824               1                1      1 0.02229 0.009796
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              5              19       0.09723                       5
## 2              1               4       0.05205                       1
## 3              1               3       0.04867                       1
## 4              5              19       0.09769                       5
## 5              2               7       0.07025                       2
## 6              1               1       0.02229                       1
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                       19       0.09480                       5
## 2                        4       0.04601                       1
## 3                        3       0.04180                       1
## 4                       19       0.09281                       5
## 5                        7       0.06560                       2
## 6                        1       0.01984                       1
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                       19       0.09237                       5
## 2                        4       0.03998                       1
## 3                        3       0.03492                       1
## 4                       19       0.08793                       5
## 5                        7       0.06095                       2
## 6                        1       0.01739                       1
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                       19       0.08994                       5
## 2                        4       0.03395                       1
## 3                        3       0.02805                       1
## 4                       19       0.08304                       5
## 5                        8       0.05629                       2
## 6                        1       0.01494                       1
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                       20       0.08750                       5
## 2                        4       0.02791                       1
## 3                        3       0.02118                       1
## 4                       18       0.07816                       5
## 5                        8       0.05164                       2
## 6                        1       0.01249                       1
##   cate_lambda_4_ranking_20
## 1                       20
## 2                        3
## 3                        2
## 4                       18
## 5                        8
## 6                        1
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.701 -0.520 -0.445  0.517  1.656 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.506506   0.060212    8.41   <2e-16 ***
## clate_W       0.056000   0.120620    0.46    0.642    
## X.gender_inp -0.068036   0.026656   -2.55    0.011 *  
## X.age_inp     0.000318   0.001099    0.29    0.773    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415     89.02  <2e-16 ***
## Wu-Hausman          1 2414      1.22    0.27    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.561 on 2415 degrees of freedom
## Multiple R-Squared: 0.0175,  Adjusted R-squared: 0.0163 
## Wald test: 3.03 on 3 and 2415 DF,  p-value: 0.0283 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.797 -0.371 -0.286  0.487  2.296 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.323148   0.044722    7.23  6.7e-13 ***
## clate_W       0.275490   0.079836    3.45  0.00057 ***
## X.gender_inp -0.069541   0.022408   -3.10  0.00194 ** 
## X.age_inp     0.000665   0.000837    0.79  0.42682    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415    174.59  <2e-16 ***
## Wu-Hausman          1 2414      0.03    0.86    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.528 on 2415 degrees of freedom
## Multiple R-Squared: 0.0629,  Adjusted R-squared: 0.0618 
## Wald test:  4.9 on 3 and 2415 DF,  p-value: 0.00212 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.265 -0.344 -0.242  0.445  2.073 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.344746   0.039993    8.62  < 2e-16 ***
## clate_W       0.347243   0.081661    4.25  2.2e-05 ***
## X.gender_inp -0.088506   0.022254   -3.98  7.2e-05 ***
## X.age_inp    -0.000447   0.000824   -0.54     0.59    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2414    172.01  <2e-16 ***
## Wu-Hausman          1 2413      2.48    0.12    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.528 on 2414 degrees of freedom
## Multiple R-Squared: 0.0339,  Adjusted R-squared: 0.0327 
## Wald test: 8.05 on 3 and 2414 DF,  p-value: 2.45e-05 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.524 -0.317 -0.254  0.338  1.464 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.332320   0.040811    8.14  6.1e-16 ***
## clate_W       0.450595   0.077437    5.82  6.7e-09 ***
## X.gender_inp -0.056256   0.020385   -2.76   0.0058 ** 
## X.age_inp    -0.000612   0.000799   -0.77   0.4440    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415    197.04  <2e-16 ***
## Wu-Hausman          1 2414      4.75   0.029 *  
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.533 on 2415 degrees of freedom
## Multiple R-Squared: 0.0521,  Adjusted R-squared: 0.0509 
## Wald test: 12.3 on 3 and 2415 DF,  p-value: 5.82e-08 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -1.543 -0.401 -0.312  0.610  1.494 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.400595   0.047858    8.37  < 2e-16 ***
## clate_W       0.304700   0.063413    4.81  1.6e-06 ***
## X.gender_inp -0.064328   0.020012   -3.21   0.0013 ** 
## X.age_inp    -0.000485   0.000928   -0.52   0.6012    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2415    322.65  <2e-16 ***
## Wu-Hausman          1 2414      0.29    0.59    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.532 on 2415 degrees of freedom
## Multiple R-Squared: 0.0623,  Adjusted R-squared: 0.0612 
## Wald test: 9.58 on 3 and 2415 DF,  p-value: 2.76e-06 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_debt_neg_alpha_5_presentation_cw0_lambda_4"
## [1] "Starting plots for outcome and ranking variable:"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_0"
## [1] "sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_4"
## [1] "#####Creating dataframe.#####"
## [1] "outcome filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "ranking filename"
## [1] "PP_Full_Analysis/Intermediate_data/Testing/empirical/cw_med_5/cate_clate_results_sim_hdl_level_neg_alpha_5_presentation_cw0.csv"
## Rows: 12,151
## Columns: 51
## $ person_id                <int> 5, 8, 16, 17, 18, 23, 24, 29, 47, 57, 59, 68,…
## $ X.numhh_list             <int> 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ X.gender_inp             <int> 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, …
## $ X.age_inp                <int> 60, 41, 39, 52, 51, 32, 34, 23, 43, 46, 38, 2…
## $ X.hispanic_inp           <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.race_white_inp         <int> 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, …
## $ X.race_black_inp         <int> 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, …
## $ X.race_nwother_inp       <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ast_dx_pre_lottery     <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, …
## $ X.dia_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.hbp_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, …
## $ X.chl_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.ami_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.chf_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.emp_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.kid_dx_pre_lottery     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.cancer_dx_pre_lottery  <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ X.dep_dx_pre_lottery     <int> 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, …
## $ X.lessHS                 <int> 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, …
## $ X.HSorGED                <int> 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, …
## $ X.charg_tot_pre_ed       <dbl> 0.0, 0.0, 1888.2, 0.0, 1715.3, 0.0, 0.0, 5743…
## $ X.ed_charg_tot_pre_ed    <dbl> 0.0, 0.0, 1888.2, 0.0, 1006.3, 0.0, 0.0, 4542…
## $ Y                        <dbl> -48.33, -51.33, -5.64, -51.33, -61.02, -31.08…
## $ clate_W                  <int> 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, …
## $ Z                        <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ weights                  <dbl> 1.1504, 0.8975, 1.0000, 1.2126, 1.0000, 1.003…
## $ folds                    <int> 8, 1, 10, 3, 10, 9, 9, 4, 4, 10, 7, 6, 5, 7, …
## $ clate                    <dbl> -3.287238, -2.857718, 65.026032, 0.302876, 58…
## $ clate_se                 <dbl> 3.897, 1.750, 1.974, 3.198, 3.386, 5.641, 4.8…
## $ clate_ranking_5          <int> 1, 1, 5, 2, 5, 3, 1, 5, 3, 2, 2, 4, 4, 1, 3, …
## $ clate_ranking_20         <int> 2, 2, 18, 8, 17, 10, 4, 20, 9, 7, 5, 13, 16, …
## $ cate_W                   <int> 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, …
## $ cate                     <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_se                  <dbl> 1.4284, 0.8423, 4.0054, 1.1931, 3.7253, 0.830…
## $ cate_ranking_5           <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_ranking_20          <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 10, 3, 13, 17…
## $ cate_lambda_0            <dbl> -1.5142, -0.6430, 21.0091, -0.1304, 17.8280, …
## $ cate_lambda_0_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_0_ranking_20 <int> 2, 5, 19, 7, 18, 11, 7, 18, 10, 9, 3, 13, 17,…
## $ cate_lambda_1            <dbl> -1.87131, -0.85360, 20.00772, -0.42862, 16.89…
## $ cate_lambda_1_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_1_ranking_20 <int> 2, 5, 19, 7, 18, 11, 6, 18, 11, 9, 3, 13, 17,…
## $ cate_lambda_2            <dbl> -2.22840, -1.06416, 19.00637, -0.72688, 15.96…
## $ cate_lambda_2_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_2_ranking_20 <int> 1, 5, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_3            <dbl> -2.58549, -1.27473, 18.00502, -1.02515, 15.03…
## $ cate_lambda_3_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 3, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_3_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 12, 9, 2, 13, 17,…
## $ cate_lambda_4            <dbl> -2.94259, -1.48530, 17.00368, -1.32341, 14.10…
## $ cate_lambda_4_ranking_5  <int> 1, 2, 5, 2, 5, 3, 2, 5, 4, 3, 1, 4, 5, 1, 3, …
## $ cate_lambda_4_ranking_20 <int> 1, 6, 19, 7, 17, 12, 6, 18, 13, 9, 2, 13, 17,…
## [1] "Non-OHP analysis - including CLATE rankings"
## [1] "Dimensions of selected_ranking_df: 12151"
## [2] "Dimensions of selected_ranking_df: 3"    
## [1] "Dimensions of outcome_df: 12151" "Dimensions of outcome_df: 51"   
## [1] "Dimensions of cdf_data: 12151" "Dimensions of cdf_data: 53"   
##   person_id cate_rankings_selected clate_rankings_selected X.numhh_list
## 1         5                      1                       1            1
## 2         8                      2                       2            2
## 3        16                      5                       5            2
## 4        17                      2                       2            1
## 5        18                      5                       5            1
## 6        23                      3                       3            2
##   X.gender_inp X.age_inp X.hispanic_inp X.race_white_inp X.race_black_inp
## 1            1        60              1                0                0
## 2            0        41              0                1                0
## 3            1        39              0                1                0
## 4            0        52              0                1                0
## 5            0        51              0                0                1
## 6            1        32              1                0                0
##   X.race_nwother_inp X.ast_dx_pre_lottery X.dia_dx_pre_lottery
## 1                  0                    0                    0
## 2                  0                    1                    0
## 3                  0                    0                    0
## 4                  0                    0                    0
## 5                  0                    0                    0
## 6                  0                    0                    0
##   X.hbp_dx_pre_lottery X.chl_dx_pre_lottery X.ami_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    1                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.chf_dx_pre_lottery X.emp_dx_pre_lottery X.kid_dx_pre_lottery
## 1                    0                    0                    0
## 2                    0                    0                    0
## 3                    0                    0                    0
## 4                    0                    0                    0
## 5                    0                    0                    0
## 6                    0                    0                    0
##   X.cancer_dx_pre_lottery X.dep_dx_pre_lottery X.lessHS X.HSorGED
## 1                       0                    0        0         1
## 2                       0                    0        0         1
## 3                       0                    0        0         1
## 4                       0                    1        1         0
## 5                       0                    0        0         0
## 6                       0                    0        1         0
##   X.charg_tot_pre_ed X.ed_charg_tot_pre_ed      Y clate_W Z weights folds
## 1                  0                     0 -48.33       0 1  1.1504     8
## 2                  0                     0 -51.33       0 0  0.8975     1
## 3               1888                  1888  -5.64       1 0  1.0000    10
## 4                  0                     0 -51.33       0 0  1.2126     3
## 5               1715                  1006 -61.02       0 0  1.0000    10
## 6                  0                     0 -31.08       1 1  1.0033     9
##     clate clate_se clate_ranking_5 clate_ranking_20 cate_W    cate cate_se
## 1 -3.2872    3.897               1                2      1 -1.5142  1.4284
## 2 -2.8577    1.750               1                2      0 -0.6430  0.8423
## 3 65.0260    1.974               5               18      0 21.0091  4.0054
## 4  0.3029    3.198               2                8      0 -0.1304  1.1931
## 5 58.0718    3.386               5               17      0 17.8280  3.7253
## 6  1.6028    5.641               3               10      1  0.5509  0.8306
##   cate_ranking_5 cate_ranking_20 cate_lambda_0 cate_lambda_0_ranking_5
## 1              1               2       -1.5142                       1
## 2              2               5       -0.6430                       2
## 3              5              19       21.0091                       5
## 4              2               7       -0.1304                       2
## 5              5              18       17.8280                       5
## 6              3              11        0.5509                       3
##   cate_lambda_0_ranking_20 cate_lambda_1 cate_lambda_1_ranking_5
## 1                        2       -1.8713                       1
## 2                        5       -0.8536                       2
## 3                       19       20.0077                       5
## 4                        7       -0.4286                       2
## 5                       18       16.8966                       5
## 6                       11        0.3433                       3
##   cate_lambda_1_ranking_20 cate_lambda_2 cate_lambda_2_ranking_5
## 1                        2       -2.2284                       1
## 2                        5       -1.0642                       2
## 3                       19       19.0064                       5
## 4                        7       -0.7269                       2
## 5                       18       15.9653                       5
## 6                       11        0.1356                       3
##   cate_lambda_2_ranking_20 cate_lambda_3 cate_lambda_3_ranking_5
## 1                        1        -2.585                       1
## 2                        5        -1.275                       2
## 3                       19        18.005                       5
## 4                        7        -1.025                       2
## 5                       17        15.034                       5
## 6                       12        -0.072                       3
##   cate_lambda_3_ranking_20 cate_lambda_4 cate_lambda_4_ranking_5
## 1                        1       -2.9426                       1
## 2                        6       -1.4853                       2
## 3                       19       17.0037                       5
## 4                        7       -1.3234                       2
## 5                       17       14.1027                       5
## 6                       12       -0.2796                       3
##   cate_lambda_4_ranking_20
## 1                        1
## 2                        6
## 3                       19
## 4                        7
## 5                       17
## 6                       12
## [1] "clate"
## [1] "#####Running clate function.#####"
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -86.73  -7.88   1.21   9.90  73.36 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -47.4718     1.3658  -34.76  < 2e-16 ***
## clate_W        0.5588     2.1182    0.26     0.79    
## X.gender_inp  -3.7106     0.5588   -6.64  3.9e-11 ***
## X.age_inp      0.0213     0.0253    0.84     0.40    
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2428     217.2  <2e-16 ***
## Wu-Hausman          1 2427       0.1    0.75    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.8 on 2428 degrees of freedom
## Multiple R-Squared: 0.0196,  Adjusted R-squared: 0.0184 
## Wald test: 15.2 on 3 and 2428 DF,  p-value: 8.04e-10 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -90.492  -8.253   0.974   9.237  57.926 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -43.0465     1.0612  -40.56  < 2e-16 ***
## clate_W        1.3993     2.2750    0.62  0.53857    
## X.gender_inp  -3.6671     0.5713   -6.42  1.7e-10 ***
## X.age_inp     -0.0837     0.0235   -3.56  0.00038 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2425    183.77  <2e-16 ***
## Wu-Hausman          1 2424      0.05    0.82    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.4 on 2425 degrees of freedom
## Multiple R-Squared: 0.0259,  Adjusted R-squared: 0.0247 
## Wald test: 21.1 on 3 and 2425 DF,  p-value: 1.63e-13 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -92.46  -7.80   1.07   9.26  50.73 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -40.8344     1.3334  -30.62  < 2e-16 ***
## clate_W       -1.3554     2.5036   -0.54     0.59    
## X.gender_inp  -3.0769     0.6210   -4.95  7.7e-07 ***
## X.age_inp     -0.1190     0.0287   -4.15  3.5e-05 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2426    136.12  <2e-16 ***
## Wu-Hausman          1 2425      1.68    0.19    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.3 on 2426 degrees of freedom
## Multiple R-Squared: 0.0113,  Adjusted R-squared: 0.0101 
## Wald test: 16.1 on 3 and 2426 DF,  p-value: 2.44e-10 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -100.02  -11.31    0.71   13.12   93.20 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -51.7457     1.6835  -30.74  < 2e-16 ***
## clate_W       13.2182     3.0074    4.40  1.2e-05 ***
## X.gender_inp  -0.4484     0.8077   -0.56   0.5789    
## X.age_inp     -0.1044     0.0334   -3.12   0.0018 ** 
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2426    158.71  <2e-16 ***
## Wu-Hausman          1 2425      7.71  0.0055 ** 
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 19 on 2426 degrees of freedom
## Multiple R-Squared: 0.225,   Adjusted R-squared: 0.225 
## Wald test: 11.8 on 3 and 2426 DF,  p-value: 1.18e-07 
## 
## [1] "Y ~ clate_W + X.gender_inp + X.age_inp | Z + X.gender_inp + X.age_inp"
## 
## Call:
## ivreg(formula = as.formula(formula_str), data = data_subset, 
##     weights = weights)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -67.58  -7.91   1.29   9.77  46.68 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -74.6610     1.2742  -58.60  < 2e-16 ***
## clate_W       67.4797     1.9069   35.39  < 2e-16 ***
## X.gender_inp  -3.2536     0.5822   -5.59  2.6e-08 ***
## X.age_inp     -0.0941     0.0231   -4.08  4.7e-05 ***
## 
## Diagnostic tests:
##                   df1  df2 statistic p-value    
## Weak instruments    1 2426    221.27  <2e-16 ***
## Wu-Hausman          1 2425      0.03    0.86    
## Sargan              0   NA        NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.5 on 2426 degrees of freedom
## Multiple R-Squared: 0.861,   Adjusted R-squared: 0.861 
## Wald test:  468 on 3 and 2426 DF,  p-value: <2e-16 
## 
## [1] "rnk"
## [1] "Q1" "Q2" "Q3" "Q4" "Q5"
## [1] "Quintile Groups ranked by sim_hdl_level_neg_alpha_5_presentation_cw0_lambda_4"