rm(list = ls())
setwd("~/Downloads")
library(foreign)
sex_data <- read.spss("sex_data.sav", use.value.label=TRUE, to.data.frame=TRUE)

Libraries/themes

library(ggplot2)
library(tidyverse)
library(gridExtra)
library(finalfit)
library(kableExtra)
library(xtable)
jrothsch_theme <-  theme_bw() + 
  theme(text = element_text(size = 10, face = "bold", color = "deepskyblue4"),panel.grid = element_blank(),axis.text = element_text(size = 10, color = "gray13"), axis.title = element_text(size = 10, color = "red"), legend.text = element_text(colour="Black", size=10), legend.title = element_text(colour="Black", size=7), plot.subtitle = element_text(size=14, face="italic", color="black"))

Removing obserations without our key variables

sex_data <- sex_data[!is.na(sex_data$status),]
sex_data <- sex_data[!is.na(sex_data$age),]
sex_data <- sex_data[!is.na(sex_data$Years_PrimaryPartner),]
sex_data <- sex_data[!is.na(sex_data$MALE),]

Making variables

sex_data <- sex_data %>%
  mutate(married = status == "Married")

sex_data <- sex_data %>%
  mutate(married_gender = ifelse(married, 
                                 ifelse(MALE == "Male", "Married Male", "Married Female"),
                                 ifelse(MALE == "Male", "Unmarried Male", "Unmarried Female ")))

  married_num =   length(sex_data$married[sex_data$married == T])
  unmarried_num =   length(sex_data$married[sex_data$married == T])
  
  sex_data <- sex_data %>% mutate(freq_num =  as.numeric(ifelse(sexfreq == "At least once per day", 6, 
                                ifelse(sexfreq == "3-4 times per week", 5,
                                  ifelse(sexfreq == 'At least once a week', 4,
                                       ifelse(sexfreq == 'At least once per month', 3, 
                                              ifelse(sexfreq =='At least once per year', 2,
                                                     ifelse( sexfreq =="Less than once a year", 1, 0))))))))
  
  
  female <- sex_data %>%
  filter(sex_data$MALE == "Female")

Binary graphs

bin_graphs_want <- function(df, mod, modname, modlabs,  interaction_labs){
  
  
  df2 = df[!is.na(df$want) & !is.na(mod),]
  mod = mod[!is.na(df$want) & !is.na(mod)]
  
    df2$mod_married = interaction(df2$married, mod)
     
    age <- ggplot(data = df2, aes(x = age, y = want, color = mod))  +
      geom_smooth() +
      labs(title = paste("Effect Of", modname, "On", "Want", " -- Age"), x = "Age", y = "Want", color = "") + 
      scale_x_continuous(limits = c(18, 80)) +
      scale_color_discrete(labels = modlabs) + 
      jrothsch_theme
  
  sum_inter <- df2 %>%
      group_by( mod_married) %>%
      summarize(DV = mean(want))
    
    mod_married <- ggplot(data = sum_inter,  aes(x = mod_married, y = DV)) +
    geom_bar(stat = 'identity', position = 'identity', fill = "Black") + 
      scale_x_discrete(labels = interaction_labs) + 
      labs(title = paste0("Interaction Between ", modname, "And Marriage"), y = "Want", x = "") +
      jrothsch_theme
    
    
    grid.arrange(age, mod_married)
    
}

bin_graphs_like <- function(df, mod, modname, modlabs, interaction_labs){
  

  df <- sex_data
  mod <- sex_data$children_in_house
  modname <-"Children In House"
  modlabs <- c("Children", "No Children")
  interaction_labs <- c("Unmarried, Children", "Married, Children", "Unmarried, No Children", "Married, No Children")
  df2 = df[!is.na(df$totlike) & !is.na(mod),]
  mod = mod[!is.na(df$totlike) & !is.na(mod)]
  table(mod)
  
    df2$mod_married = interaction(df2$married, mod)
     
    age <- ggplot(data = df2, aes(x = age, y = totlike, color = mod))  +
       geom_smooth() + 
      labs(title = paste("Effect Of", modname, "On", "Like", " -- Age"), x = "Age", y = "Like", color = "") + 
      scale_x_continuous(limits = c(18, 80)) +
      scale_color_discrete(labels = modlabs) + 
      jrothsch_theme
  
  sum_inter <- df2 %>%
      group_by( mod_married) %>%
      summarize(DV = mean(totlike))
    
    mod_married <- ggplot(data = sum_inter,  aes(x = mod_married, y = DV)) +
    geom_bar(stat = 'identity', position = 'identity', fill = "black") +
         scale_x_discrete(labels = interaction_labs) + 
      labs(title = paste0("Interaction Between ", modname, "And Marriage"), y = "Like", x = "") +
      jrothsch_theme
    
    
    grid.arrange(age, mod_married)
    
}
bin_graphs_freq <- function(df, mod, modname, modlabs, interaction_labs){
  

  
  df2 = df[!is.na(df$freq_num) & !is.na(mod),]
  mod = mod[!is.na(df$freq_num) & !is.na(mod)]
  
    df2$mod_married = interaction(df2$married, mod)
     
    age <- ggplot(data = df2, aes(x = age, y = freq_num, color = mod))  +
      geom_smooth() +
      labs(title = paste("Effect Of", modname, "On", "Frequency", " -- Age"), x = "Age", y = "Frequency", color = "") + 
      scale_x_continuous(limits = c(18, 80)) +
      scale_color_discrete(labels = modlabs) + 
      jrothsch_theme
  
  sum_inter <- df2 %>%
      group_by(mod_married) %>%
      summarize(DV = mean(freq_num))
    
    mod_married <- ggplot(data = sum_inter,  aes(x = mod_married, y = DV)) +
    geom_bar(stat = 'identity', position = 'identity', fill = "black") +    
      scale_x_discrete(labels = interaction_labs) + 
      labs(title = paste0("Interaction Between ", modname, "And Marriage"), y = "Frequency", x = "") +
      jrothsch_theme
    
    
    grid.arrange(age, mod_married)
    
}

Small continuous graphs

contsmall <- function(df, mod, modname, modlabs){

  
  df2 = df[!is.na(df$want) & !is.na(df$totlike) & !is.na(df$freq_num ) & !is.na(mod) ,]
  mod = mod[!is.na(df$want) & !is.na(df$totlike) & !is.na(df$freq_num ) & !is.na(mod)]




want <- ggplot(df2, aes(x=mod, y = want)) +
  stat_summary_bin(fun.y='mean', bins=20,
                    size=2, geom='point', mapping = aes(group = married, color = married)) +
  geom_smooth(method='lm', se = F,  size= 1, aes(color = married)) + jrothsch_theme +
    labs( x = modname, y = "Want")
  
like <- ggplot(df2, aes(x=mod, y = totlike)) +
  stat_summary_bin(fun.y='mean', bins=20,
                    size=2, geom='point', mapping = aes(group = married, color = married)) +
  geom_smooth(method='lm', se = F,  size= 1, aes(color = married)) + jrothsch_theme +
    labs( x = modname, y = "Like")




freq <- ggplot(df2, aes(x=mod, y=  freq_num)) +
  stat_summary_bin(fun.y='mean', bins=20,
                    size=2, geom='point', mapping = aes(group = married, color = married)) +
  geom_smooth(method='lm', se = F, aes(color = married)) + jrothsch_theme +
      labs( x = modname, y = "Frequency")

  

grid.arrange(want, like, freq)

}

Regressions – Standard

###################################################################################################################################
#REgressions
#########################################################################################################################
  reg_no_mod <- function(dv, df){
      dv <- as.numeric(dv)
  tx1 <- df %>% lm(dv ~ married, data = .)

  
  tx1 <- xtable(tx1)
  colnames(tx1)[colnames(tx1)=="Pr(>|t|)"] <- "p_value"
    colnames(tx1)[colnames(tx1)=="t value"] <- "t_value"

  
  tx1 <- tx1 %>%
    mutate(p_value = round(p_value, 4)) %>%
    mutate(t_value = round(t_value, 3)) %>%
    mutate(p_value= cell_spec(p_value, "html", background = ifelse(p_value < .01, "gold", "white"))) %>%
    mutate(t_value= cell_spec(t_value, "html", background = ifelse(t_value < -2.5, "#FF6347", 
                                                                   ifelse(t_value > 2.5, "lightgreen", "white"))))

  
  rownames(tx1) <- c("Intercept", "Married: True")
  
kable(tx1, row.names= T, align=c("l", "l", "r", "r", "r", "r")  ,
            booktabs=TRUE, escape = F) %>% 
    kable_styling(font_size=8) 
    
  }


###########################################################################################################################
  reg_no_mod_i <- function(dv, df){

  dv <- as.numeric(dv)
  tx1 <- df %>% lm(dv ~ married + age + married*age, data = .)

  tx1 <- xtable(tx1)
  colnames(tx1)[colnames(tx1)=="Pr(>|t|)"] <- "p_value"
    colnames(tx1)[colnames(tx1)=="t value"] <- "t_value"

  
  tx1 <- tx1 %>%
    mutate(p_value = round(p_value, 4)) %>%
    mutate(t_value = round(t_value, 3)) %>%
    mutate(p_value= cell_spec(p_value, "html", background = ifelse(p_value < .01, "gold", "white"))) %>%
    mutate(t_value= cell_spec(t_value, "html", background = ifelse(t_value < -2.5, "#FF6347", 
                                                                   ifelse(t_value > 2.5, "lightgreen", "white"))))

  
  rownames(tx1) <- c("Intercept", "Married: TRUE", "Age",  "Married X Age")
  
kable(tx1, row.names= T, align=c("l", "l", "r", "r", "r", "r")  ,
            booktabs=TRUE, escape = F) %>% 
    kable_styling(font_size=8) 
    
  }

##################################################################################################################

  reg_no_mod_control <- function(dv, df){

  dv <- as.numeric(dv)
  tx1 <- df %>% lm(dv ~ married + age +  Years_PrimaryPartner + MALE, data = .)

  tx1 <- xtable(tx1)
  colnames(tx1)[colnames(tx1)=="Pr(>|t|)"] <- "p_value"
    colnames(tx1)[colnames(tx1)=="t value"] <- "t_value"

  
  tx1 <- tx1 %>%
    mutate(p_value = round(p_value, 4)) %>%
    mutate(t_value = round(t_value, 3)) %>%
    mutate(p_value= cell_spec(p_value, "html", background = ifelse(p_value < .01, "gold", "white"))) %>%
    mutate(t_value= cell_spec(t_value, "html", background = ifelse(t_value < -2.5, "#FF6347", 
                                                                   ifelse(t_value > 2.5, "lightgreen", "white"))))

  
  rownames(tx1) <- c("Intercept", "Married: TRUE", "Age",  "Duration", "MALE")
  
kable(tx1, row.names= T, align=c("l", "l", "r", "r", "r")  ,
            booktabs=TRUE, escape = F) %>% 
    kable_styling(font_size=8) 
    
  }

##################################################################################################################

  reg_just_mod_i <- function(dv, df, mod, modname){
    
      dv <- as.numeric(dv)
  tx1 <- df %>% lm(dv ~ married + mod, data = .)

  
  tx1 <- xtable(tx1)
  colnames(tx1)[colnames(tx1)=="Pr(>|t|)"] <- "p_value"
    colnames(tx1)[colnames(tx1)=="t value"] <- "t_value"

  
  tx1 <- tx1 %>%
    mutate(p_value = round(p_value, 4)) %>%
    mutate(t_value = round(t_value, 3)) %>%
    mutate(p_value= cell_spec(p_value, "html", background = ifelse(p_value < .01, "gold", "white"))) %>%
    mutate(t_value= cell_spec(t_value, "html", background = ifelse(t_value < -2.5, "#FF6347", 
                                                                   ifelse(t_value > 2.5, "lightgreen", "white"))))

  
  rownames(tx1) <- c("Intercept", "Married: True", modname)
  
kable(tx1, row.names= T, align=c("l", "l", "r", "r", "r")  ,
            booktabs=TRUE, escape = F) %>% 
    kable_styling(font_size=8) 
    
  }
  
#############################################################################################################################################################################################################################################################
  reg_full_control <- function(dv, df, mod, modname){
     
     dv <- as.numeric(dv)
       tx1 <- df %>% lm(dv ~ married + mod + age + Years_PrimaryPartner + MALE, data = .)
  
      
  tx1 <- xtable(tx1)
  colnames(tx1)[colnames(tx1)=="Pr(>|t|)"] <- "p_value"
    colnames(tx1)[colnames(tx1)=="t value"] <- "t_value"

  
  tx1 <- tx1 %>%
    mutate(p_value = round(p_value, 4)) %>%
    mutate(t_value = round(t_value, 3)) %>%
    mutate(p_value= cell_spec(p_value, "html", background = ifelse(p_value < .01, "gold", "white"))) %>%
    mutate(t_value= cell_spec(t_value, "html", background = ifelse(t_value < -2.5, "#FF6347", 
                                                                   ifelse(t_value > 2.5, "lightgreen", "white"))))

  
  rownames(tx1) <- c("Intercept", "Married: True", modname, "Age (years)", "Duration", "Male")
  
kable(tx1, row.names= T, align=c("l", "l", "r", "r", "r")  ,
            booktabs=TRUE, escape = F) %>% 
    kable_styling(font_size=8) 
    
  
    
  }


 


#############################################################################################################################################################################################################################################################
  reg_full_control_i <- function(dv, df, mod, modname){
    
          dv <- as.numeric(dv)
  tx1 <- df %>% lm(dv ~ married + mod + age + Years_PrimaryPartner + MALE + married*age, data = .)

  
  tx1 <- xtable(tx1)
  colnames(tx1)[colnames(tx1)=="Pr(>|t|)"] <- "p_value"
    colnames(tx1)[colnames(tx1)=="t value"] <- "t_value"

  
  tx1 <- tx1 %>%
    mutate(p_value = round(p_value, 4)) %>%
    mutate(t_value = round(t_value, 3)) %>%
    mutate(p_value= cell_spec(p_value, "html", background = ifelse(p_value < .01, "gold", "white"))) %>%
    mutate(t_value= cell_spec(t_value, "html", background = ifelse(t_value < -2.5, "#FF6347", 
                                                                   ifelse(t_value > 2.5, "lightgreen", "white"))))

  
  rownames(tx1) <- c("Intercept", "Married: True", modname, "Age (years)", "Duration", "Male", "Married X Age")
  
kable(tx1, row.names= T, align=c("l", "l", "r", "r")  ,
            booktabs=TRUE, escape = F) %>% 
    kable_styling(font_size=8) 
  }

Subsets where controls can’t be used – e.g. one gender subsets

     reg_full_control_gend <- function(dv, df, mod, modname){

    
      dv <- as.numeric(dv)
      
       tx1 <- df %>% lm(dv ~ married + mod + age + Years_PrimaryPartner, data = .)
  
      
  tx1 <- xtable(tx1)
  colnames(tx1)[colnames(tx1)=="Pr(>|t|)"] <- "p_value"
    colnames(tx1)[colnames(tx1)=="t value"] <- "t_value"

  
  tx1 <- tx1 %>%
    mutate(p_value = round(p_value, 4)) %>%
    mutate(t_value = round(t_value, 3)) %>%
    mutate(p_value= cell_spec(p_value, "html", background = ifelse(p_value < .01, "gold", "white"))) %>%
    mutate(t_value= cell_spec(t_value, "html", background = ifelse(t_value < -2.5, "#FF6347", 
                                                                   ifelse(t_value > 2.5, "lightgreen", "white"))))

  
  rownames(tx1) <- c("Intercept", "Married: True", modname, "Age (years)", "Duration" )
  
kable(tx1, row.names= T, align=c("l", "l", "r", "r")  ,
            booktabs=TRUE, escape = F) %>% 
    kable_styling(font_size=8) 
    
  
    
     }

 reg_full_control_gend_i <- function(dv, df, mod, modname){
    
          dv <- as.numeric(dv)
  tx1 <- df %>% lm(dv ~ married + mod + age + Years_PrimaryPartner + age*married, data = .)

  
  tx1 <- xtable(tx1)
  colnames(tx1)[colnames(tx1)=="Pr(>|t|)"] <- "p_value"
    colnames(tx1)[colnames(tx1)=="t value"] <- "t_value"

  
  tx1 <- tx1 %>%
    mutate(p_value = round(p_value, 4)) %>%
    mutate(t_value = round(t_value, 3)) %>%
    mutate(p_value= cell_spec(p_value, "html", background = ifelse(p_value < .01, "gold", "white"))) %>%
    mutate(t_value= cell_spec(t_value, "html", background = ifelse(t_value < -2.5, "#FF6347", 
                                                                   ifelse(t_value > 2.5, "lightgreen", "white"))))

  
  rownames(tx1) <- c("Intercept", "Married: True", modname, "Age (years)", "Duration", "Married X Age")
  
kable(tx1, row.names= T, align=c("l", "l", "r", "r")  ,
            booktabs=TRUE, escape = F) %>% 
    kable_styling(font_size=8) 
  }

Looking at modertators interaction with marriage

  ireg_just_mod_i <- function(dv, df, mod, modname){
    
      dv <- as.numeric(dv)
  tx1 <- df %>% lm(dv ~ married + mod + married*mod, data = .)

  
  tx1 <- xtable(tx1)
  colnames(tx1)[colnames(tx1)=="Pr(>|t|)"] <- "p_value"
    colnames(tx1)[colnames(tx1)=="t value"] <- "t_value"

  
  tx1 <- tx1 %>%
    mutate(p_value = round(p_value, 4)) %>%
    mutate(t_value = round(t_value, 3)) %>%
    mutate(p_value= cell_spec(p_value, "html", background = ifelse(p_value < .01, "gold", "white"))) %>%
    mutate(t_value= cell_spec(t_value, "html", background = ifelse(t_value < -2.5, "#FF6347", 
                                                                   ifelse(t_value > 2.5, "lightgreen", "white"))))

  
  rownames(tx1) <- c("Intercept", "Married: True", modname, paste("Married X", modname))
  
kable(tx1, row.names= T, align=c("l", "l", "r", "r", "r", "r")  ,
            booktabs=TRUE, escape = F) %>% 
    kable_styling(font_size=8) 
    
  }
  
#############################################################################################################################################################################################################################################################
  ireg_full_control <- function(dv, df, mod, modname){
     
     dv <- as.numeric(dv)
       tx1 <- df %>% lm(dv ~ married + mod + age + Years_PrimaryPartner + MALE + married*mod, data = .)
  
      
  tx1 <- xtable(tx1)
  colnames(tx1)[colnames(tx1)=="Pr(>|t|)"] <- "p_value"
    colnames(tx1)[colnames(tx1)=="t value"] <- "t_value"

  
  tx1 <- tx1 %>%
    mutate(p_value = round(p_value, 4)) %>%
    mutate(t_value = round(t_value, 3)) %>%
    mutate(p_value= cell_spec(p_value, "html", background = ifelse(p_value < .01, "gold", "white"))) %>%
    mutate(t_value= cell_spec(t_value, "html", background = ifelse(t_value < -2.5, "#FF6347", 
                                                                   ifelse(t_value > 2.5, "lightgreen", "white"))))

  
  rownames(tx1) <- c("Intercept", "Married: True", modname, "Age (years)", "Duration", "Male",  paste("Married X", modname))
  
kable(tx1, row.names= T, align=c("l", "l", "r", "r", "r", "r")  ,
            booktabs=TRUE, escape = F) %>% 
    kable_styling(font_size=8) 
    
  
    
  }


 


#############################################################################################################################################################################################################################################################
  ireg_full_control_i <- function(dv, df, mod, modname){
    
          dv <- as.numeric(dv)
  tx1 <- df %>% lm(dv ~ married + mod + age + Years_PrimaryPartner + MALE + age*married + married*mod, data = .)

  
  tx1 <- xtable(tx1)
  colnames(tx1)[colnames(tx1)=="Pr(>|t|)"] <- "p_value"
    colnames(tx1)[colnames(tx1)=="t value"] <- "t_value"

  
  tx1 <- tx1 %>%
    mutate(p_value = round(p_value, 4)) %>%
    mutate(t_value = round(t_value, 3)) %>%
    mutate(p_value= cell_spec(p_value, "html", background = ifelse(p_value < .01, "gold", "white"))) %>%
    mutate(t_value= cell_spec(t_value, "html", background = ifelse(t_value < -2.5, "#FF6347", 
                                                                   ifelse(t_value > 2.5, "lightgreen", "white"))))

  
  rownames(tx1) <- c("Intercept", "Married: True", modname, "Age (years)", "Duration", "Male", "Married X Age",  paste("Married X", modname))
  
kable(tx1, row.names= T, align=c("l", "l", "r", "r", "r", "r")  ,
            booktabs=TRUE, escape = F) %>% 
    kable_styling(font_size=8) 
  }
  
  
  
   
    
    #############################################################################################################################################################################################################################################################
   #For subsets wheere we can't use all controls
    
    #############################################################################################################################################################################################################################################################
    
     ireg_full_control_gend <- function(dv, df, mod, modname){

    
      dv <- as.numeric(dv)
      
       tx1 <- df %>% lm(dv ~ married + mod + age + Years_PrimaryPartner + married*mod, data = .)
  
      
  tx1 <- xtable(tx1)
  colnames(tx1)[colnames(tx1)=="Pr(>|t|)"] <- "p_value"
    colnames(tx1)[colnames(tx1)=="t value"] <- "t_value"

  
  tx1 <- tx1 %>%
    mutate(p_value = round(p_value, 4)) %>%
    mutate(t_value = round(t_value, 3)) %>%
    mutate(p_value= cell_spec(p_value, "html", background = ifelse(p_value < .01, "gold", "white"))) %>%
    mutate(t_value= cell_spec(t_value, "html", background = ifelse(t_value < -2.5, "#FF6347", 
                                                                   ifelse(t_value > 2.5, "lightgreen", "white"))))

  
  rownames(tx1) <- c("Intercept", "Married: True", modname, "Age (years)", "Duration",  paste("Married X", modname))
  
kable(tx1, row.names= T, align=c("l", "l", "r", "r",  "r")  ,
            booktabs=TRUE, escape = F) %>% 
    kable_styling(font_size=8) 
    
  
    
     }

 ireg_full_control_gend_i <- function(dv, df, mod, modname){
    
          dv <- as.numeric(dv)
  tx1 <- df %>% lm(dv ~ married + mod + age + Years_PrimaryPartner + age*married + married*mod, data = .)

  
  tx1 <- xtable(tx1)
  colnames(tx1)[colnames(tx1)=="Pr(>|t|)"] <- "p_value"
    colnames(tx1)[colnames(tx1)=="t value"] <- "t_value"

  
  tx1 <- tx1 %>%
    mutate(p_value = round(p_value, 4)) %>%
    mutate(t_value = round(t_value, 3)) %>%
    mutate(p_value= cell_spec(p_value, "html", background = ifelse(p_value < .01, "gold", "white"))) %>%
    mutate(t_value= cell_spec(t_value, "html", background = ifelse(t_value < -2.5, "#FF6347", 
                                                                   ifelse(t_value > 2.5, "lightgreen", "white"))))

  
  rownames(tx1) <- c("Intercept", "Married: True", modname, "Age (years)", "Duration", "Married X Age",  paste("Married X", modname))
  
kable(tx1, row.names= T, align=c("l", "l", "r", "r", "r")  ,
            booktabs=TRUE, escape = F) %>% 
    kable_styling(font_size=8) 
  }

Marriage on Want/Age/Like without mediators, with or without controls, for comparison

Want - Marriage

reg_no_mod(sex_data$want, sex_data )
Estimate Std. Error t_value p_value
Intercept 28.927462 0.2358428 122.656 0
Married: True -5.062436 0.2804827 -18.049 0

Like - Marriage

reg_no_mod(sex_data$totlike, sex_data )
Estimate Std. Error t_value p_value
Intercept 38.524460 0.2654955 145.104 0
Married: True -3.954296 0.3168241 -12.481 0

Frequency - Marriage

reg_no_mod(sex_data$freq_num, sex_data)
Estimate Std. Error t_value p_value
Intercept 3.6641623 0.0408283 89.746 0
Married: True -0.6595098 0.0480844 -13.716 0

Want - Marriage, controls

reg_no_mod_control(sex_data$want, sex_data )
Estimate Std. Error t_value p_value
Intercept 33.6515234 0.3616805 93.042 0
Married: TRUE -2.4498192 0.2836310 -8.637 0
Age -0.1788330 0.0079330 -22.543 0
Duration -0.0164498 0.0049803 -3.303 0.001
MALE 4.5428634 0.2430139 18.694 0

Like - Marriage, controls

reg_no_mod_control(sex_data$totlike, sex_data)
Estimate Std. Error t_value p_value
Intercept 40.9088281 0.4368889 93.637 0
Married: TRUE -2.6911441 0.3412552 -7.886 0
Age -0.0852356 0.0095901 -8.888 0
Duration -0.0098875 0.0058960 -1.677 0.0936
MALE 1.9027594 0.2944406 6.462 0

Frequency - Marriage, controls

reg_no_mod_control(sex_data$freq_num, sex_data)
Estimate Std. Error t_value p_value
Intercept 4.8698702 0.0640338 76.052 0
Married: TRUE -0.1485242 0.0488622 -3.04 0.0024
Age -0.0334322 0.0014244 -23.471 0
Duration -0.0032137 0.0010801 -2.975 0.0029
MALE 0.2339988 0.0411009 5.693 0

Economic Security Correlates With Higher W/L/F, But Doesn’t Affect Marriage Estimates

Graphs

sex_data$SecureNum = as.numeric(sex_data$econ_secure)

contsmall(sex_data, sex_data$SecureNum, "Economic Security", "")

Want - Only Economic Security

reg_just_mod_i(sex_data$want, sex_data, sex_data$SecureNum, "Economic Security")
Estimate Std. Error t_value p_value
Intercept 28.1024819 0.3539723 79.392 0
Married: True -4.9898408 0.2910801 -17.143 0
Economic Security 0.2669037 0.0702588 3.799 1e-04

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$SecureNum, "Economic Security")
Estimate Std. Error t_value p_value
Intercept 32.2402534 0.4269611 75.511 0
Married: True -2.5032814 0.2928144 -8.549 0
Economic Security 0.4279101 0.0657507 6.508 0
Age (years) -0.1780372 0.0082507 -21.579 0
Duration -0.0164754 0.0049954 -3.298 0.001
Male 4.4305888 0.2528991 17.519 0

Like - Only Economic Security

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$SecureNum,"Economic Security")
Estimate Std. Error t_value p_value
Intercept 35.579222 0.3894035 91.369 0
Married: True -4.215278 0.3202160 -13.164 0
Economic Security 0.798112 0.0772914 10.326 0

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$SecureNum, "Economic Security")
Estimate Std. Error t_value p_value
Intercept 38.0229422 0.4994597 76.128 0
Married: True -2.7885252 0.3425347 -8.141 0
Economic Security 0.8980070 0.0769152 11.675 0
Age (years) -0.0950957 0.0096516 -9.853 0
Duration -0.0129868 0.0058436 -2.222 0.0263
Male 1.8234063 0.2958418 6.163 0

Frequency - Only Economic Security

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$SecureNum, "Economic Security")
Estimate Std. Error t_value p_value
Intercept 3.5719567 0.0597229 59.809 0
Married: True -0.6416354 0.0495148 -12.958 0
Economic Security 0.0338985 0.0118347 2.864 0.0042

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$SecureNum, "Economic Security")
Estimate Std. Error t_value p_value
Intercept 4.6149388 0.0737187 62.602 0
Married: True -0.1658769 0.0499455 -3.321 9e-04
Economic Security 0.0751823 0.0110847 6.783 0
Age (years) -0.0330308 0.0014658 -22.535 0
Duration -0.0031195 0.0010744 -2.904 0.0037
Male 0.2217620 0.0424541 5.224 0

Feeling Personally Hurt By the Economic Downturn Lowers Like And Frequency, But Doesn’t Affect Marriage

Graphs

sex_data$HurtNum = as.numeric(sex_data$econ_hurt)

contsmall(sex_data, sex_data$HurtNum, "Economic Hurt", "")

Want - Only Economic Hurt

reg_just_mod_i(sex_data$want, sex_data, sex_data$HurtNum, "Economic Hurt")
Estimate Std. Error t_value p_value
Intercept 29.2782602 0.4073395 71.877 0
Married: True -4.8942777 0.2904324 -16.852 0
Economic Hurt -0.0444954 0.0736562 -0.604 0.5458

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$HurtNum, "Economic Hurt")
Estimate Std. Error t_value p_value
Intercept 33.7736842 0.4829793 69.928 0
Married: True -2.4556816 0.2941520 -8.348 0
Economic Hurt -0.0437978 0.0683929 -0.64 0.522
Age (years) -0.1729108 0.0082511 -20.956 0
Duration -0.0145745 0.0050102 -2.909 0.0036
Male 4.4804931 0.2539606 17.642 0

Like - Only Economic Hurt

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$HurtNum,"Economic Hurt")
Estimate Std. Error t_value p_value
Intercept 40.272139 0.4514913 89.198 0
Married: True -3.955757 0.3219125 -12.288 0
Economic Hurt -0.398369 0.0816399 -4.88 0

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$HurtNum, "Economic Hurt")
Estimate Std. Error t_value p_value
Intercept 42.5976932 0.5692948 74.825 0
Married: True -2.7202765 0.3467212 -7.846 0
Economic Hurt -0.3978147 0.0806157 -4.935 0
Age (years) -0.0843628 0.0097257 -8.674 0
Duration -0.0089079 0.0059056 -1.508 0.1315
Male 1.9298237 0.2993471 6.447 0

Frequency - Only Economic Hurt

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$HurtNum, "Economic Hurt")
Estimate Std. Error t_value p_value
Intercept 3.8205804 0.0688016 55.53 0
Married: True -0.6292731 0.0492935 -12.766 0
Economic Hurt -0.0285361 0.0124015 -2.301 0.0214

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$HurtNum, "Economic Hurt")
Estimate Std. Error t_value p_value
Intercept 4.9816202 0.0832645 59.829 0
Married: True -0.1561676 0.0501474 -3.114 0.0019
Economic Hurt -0.0312331 0.0115256 -2.71 0.0068
Age (years) -0.0320833 0.0014656 -21.89 0
Duration -0.0027764 0.0010779 -2.576 0.01
Male 0.2309884 0.0426271 5.419 0

Feeling Anxious About The Economy Lowers Like And Frequency, But Doesn’t Affect Marriage

Graphs

sex_data$AnxNum = as.numeric(sex_data$econ_anxious)

contsmall(sex_data, sex_data$AnxNum, "Economic Anxiety", "")

Want - Only Economic Anxiety

reg_just_mod_i(sex_data$want, sex_data, sex_data$AnxNum, "Economic Anxiety")
Estimate Std. Error t_value p_value
Intercept 29.0342250 0.4203434 69.073 0
Married: True -4.8890687 0.2904131 -16.835 0
Economic Anxiety 0.0105147 0.0772909 0.136 0.8918

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$AnxNum, "Economic Anxiety")
Estimate Std. Error t_value p_value
Intercept 33.8383957 0.5085759 66.536 0
Married: True -2.4504488 0.2940631 -8.333 0
Economic Anxiety -0.0544082 0.0719874 -0.756 0.4498
Age (years) -0.1733125 0.0082684 -20.961 0
Duration -0.0145353 0.0050105 -2.901 0.0037
Male 4.4749506 0.2540526 17.614 0

Like - Only Economic Anxiety

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$AnxNum,"Economic Anxiety")
Estimate Std. Error t_value p_value
Intercept 40.5510888 0.4656180 87.091 0
Married: True -3.9518542 0.3216931 -12.285 0
Economic Anxiety -0.4613249 0.0856158 -5.388 0

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$AnxNum, "Economic Anxiety")
Estimate Std. Error t_value p_value
Intercept 43.2109527 0.5987891 72.164 0
Married: True -2.6726777 0.3462251 -7.719 0
Economic Anxiety -0.4995435 0.0847568 -5.894 0
Age (years) -0.0880516 0.0097351 -9.045 0
Duration -0.0085469 0.0058993 -1.449 0.1475
Male 1.8789597 0.2991174 6.282 0

Frequency - Only Economic Anxiety

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$AnxNum, "Economic Anxiety")
Estimate Std. Error t_value p_value
Intercept 3.7804814 0.0711089 53.165 0
Married: True -0.6285247 0.0493099 -12.746 0
Economic Anxiety -0.0194401 0.0130398 -1.491 0.1361

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$AnxNum, "Economic Anxiety")
Estimate Std. Error t_value p_value
Intercept 5.0477169 0.0876969 57.559 0
Married: True -0.1523044 0.0501219 -3.039 0.0024
Economic Anxiety -0.0428054 0.0121509 -3.523 4e-04
Age (years) -0.0324144 0.0014679 -22.083 0
Duration -0.0027405 0.0010771 -2.544 0.011
Male 0.2262950 0.0426178 5.31 0

Education Level Has Little Effect, Increases Marriage Like Estimate

Graphs

sex_data$EducNum = as.numeric(sex_data$educ)

contsmall(sex_data, sex_data$AnxNum, "Education Level", "")

Want - Only Education

reg_just_mod_i(sex_data$want, sex_data, sex_data$EducNum, "Education Level")
Estimate Std. Error t_value p_value
Intercept 29.5532773 0.3992271 74.026 0
Married: True -4.8682097 0.2910248 -16.728 0
Education Level -0.1404548 0.0917818 -1.53 0.126

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$EducNum, "Education Level")
Estimate Std. Error t_value p_value
Intercept 33.5829662 0.4531463 74.111 0
Married: True -2.4561218 0.2943536 -8.344 0
Education Level -0.0016097 0.0862935 -0.019 0.9851
Age (years) -0.1728834 0.0083183 -20.783 0
Duration -0.0146329 0.0050097 -2.921 0.0035
Male 4.4753205 0.2548165 17.563 0

Like - Only Education

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$EducNum,"Education Level")
Estimate Std. Error t_value p_value
Intercept 39.342560 0.4440245 88.604 0
Married: True -3.885504 0.3236807 -12.004 0
Education Level -0.240647 0.1020806 -2.357 0.0184

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$EducNum, "Education Level")
Estimate Std. Error t_value p_value
Intercept 41.3409496 0.5360001 77.129 0
Married: True -2.6848860 0.3481735 -7.711 0
Education Level -0.1670266 0.1020715 -1.636 0.1018
Age (years) -0.0827136 0.0098393 -8.406 0
Duration -0.0091332 0.0059256 -1.541 0.1233
Male 1.9677495 0.3014075 6.529 0

Frequency - Only Education

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$EducNum, "Education Level")
Estimate Std. Error t_value p_value
Intercept 3.7804564 0.0680426 55.56 0
Married: True -0.6235493 0.0494678 -12.605 0
Education Level -0.0251669 0.0154655 -1.627 0.1037

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$EducNum, "Education Level")
Estimate Std. Error t_value p_value
Intercept 4.7968498 0.0791281 60.621 0
Married: True -0.1550942 0.0502657 -3.085 0.002
Education Level 0.0157017 0.0145205 1.081 0.2796
Age (years) -0.0322418 0.0014761 -21.843 0
Duration -0.0027959 0.0010793 -2.591 0.0096
Male 0.2267135 0.0428281 5.294 0

___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

No Income Effect, Possibly Some Specific Outlier Income Groups

Graphs

sex_data$IncomeNum = as.numeric(sex_data$HouseholdIncome)

contsmall(sex_data, sex_data$IncomeNum, "Income Level", "")

Want - Only Income

reg_just_mod_i(sex_data$want, sex_data, sex_data$IncomeNum, "Income Level")
Estimate Std. Error t_value p_value
Intercept 28.7239484 0.4557908 63.02 0
Married: True -5.0549824 0.4141058 -12.207 0
Income Level -0.0906243 0.1123780 -0.806 0.4201

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$IncomeNum, "Income Level")
Estimate Std. Error t_value p_value
Intercept 33.9389741 0.5825240 58.262 0
Married: True -2.4014129 0.4276577 -5.615 0
Income Level -0.0754337 0.1051256 -0.718 0.4731
Age (years) -0.1838015 0.0115380 -15.93 0
Duration -0.0072029 0.0053718 -1.341 0.1801
Male 4.2568551 0.3774423 11.278 0

Like - Only Income

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$IncomeNum,"Income Level")
Estimate Std. Error t_value p_value
Intercept 38.1934517 0.5016493 76.136 0
Married: True -3.8375362 0.4557702 -8.42 0
Income Level -0.0461524 0.1236847 -0.373 0.7091

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$IncomeNum, "Income Level")
Estimate Std. Error t_value p_value
Intercept 40.5011138 0.6815216 59.427 0
Married: True -2.6851216 0.5003363 -5.367 0
Income Level -0.0410305 0.1229913 -0.334 0.7387
Age (years) -0.0819290 0.0134988 -6.069 0
Duration -0.0018835 0.0062847 -0.3 0.7644
Male 1.9336434 0.4415870 4.379 0

Frequency - Only Income

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$IncomeNum, "Income Level")
Estimate Std. Error t_value p_value
Intercept 3.5291093 0.0772604 45.678 0
Married: True -0.7205595 0.0697380 -10.332 0
Income Level 0.0309751 0.0188795 1.641 0.101

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$IncomeNum, "Income Level")
Estimate Std. Error t_value p_value
Intercept 4.5753121 0.1018641 44.916 0
Married: True -0.2455662 0.0732116 -3.354 8e-04
Income Level 0.0475445 0.0178977 2.656 0.008
Age (years) -0.0300907 0.0020378 -14.766 0
Duration -0.0015402 0.0012051 -1.278 0.2014
Male 0.1844088 0.0640869 2.877 0.0041

Partner Age Shows A Similar Effect to Age; The Marriage Effect Comes From A Steeper Decline With Age

Graphs

sex_data <- sex_data %>% mutate(partner_agecat = ifelse(partner_age < 30, 1,
                                                        ifelse(partner_age < 40 & partner_age >= 30, 2,
                                                               ifelse(partner_age < 50 & partner_age >= 40, 3,
                                                                      ifelse(partner_age  < 60 & partner_age >= 50, 4 ,5))))
                                )

contsmall(sex_data, sex_data$partner_agecat, "Partner Age Bucket", "")

Want - Only Education

reg_just_mod_i(sex_data$want, sex_data, sex_data$partner_age, "Partner Age")
Estimate Std. Error t_value p_value
Intercept 35.6876997 0.3667337 97.312 0
Married: True -2.4991131 0.2881915 -8.672 0
Partner Age -0.1801903 0.0077411 -23.277 0

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$partner_age, "Partner Age")
Estimate Std. Error t_value p_value
Intercept 34.0394728 0.3792510 89.754 0
Married: True -2.3508670 0.2848575 -8.253 0
Partner Age -0.0633540 0.0188267 -3.365 8e-04
Age (years) -0.1232009 0.0183332 -6.72 0
Duration -0.0147545 0.0050005 -2.951 0.0032
Male 4.2562491 0.2572687 16.544 0

Like - Only Education

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$partner_age,"Partner Age")
Estimate Std. Error t_value p_value
Intercept 42.1696109 0.4324816 97.506 0
Married: True -2.6010701 0.3381217 -7.693 0
Partner Age -0.0972413 0.0091714 -10.603 0

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$partner_age, "Partner Age")
Estimate Std. Error t_value p_value
Intercept 41.4568818 0.4576758 90.581 0
Married: True -2.5494021 0.3425991 -7.441 0
Partner Age -0.0900794 0.0227706 -3.956 1e-04
Age (years) -0.0060467 0.0221898 -0.273 0.7852
Duration -0.0076745 0.0059133 -1.298 0.1944
Male 1.4971609 0.3113452 4.809 0

Frequency - Only Education

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$partner_age, "Partner Age")
Estimate Std. Error t_value p_value
Intercept 5.0380031 0.0620456 81.198 0
Married: True -0.1575805 0.0480595 -3.279 0.001
Partner Age -0.0359067 0.0012849 -27.944 0

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$partner_age, "Partner Age")
Estimate Std. Error t_value p_value
Intercept 4.9779925 0.0672407 74.032 0
Married: True -0.1265578 0.0489196 -2.587 0.0097
Partner Age -0.0164814 0.0032074 -5.139 0
Age (years) -0.0191987 0.0031130 -6.167 0
Duration -0.0024071 0.0010886 -2.211 0.0271
Male 0.1605635 0.0434115 3.699 2e-04

Being Older Than Partner Improves W/L/F, Unrelated To Marriage

Graphs

sex_data <-sex_data  %>% mutate(dif = age - partner_age)
sex_data <- sex_data %>% mutate(dif_cat = ifelse(dif < -10, 1,
                                                        ifelse(dif < -5  & dif >= -10, 2,
                                                               ifelse(dif < -1 & dif >= -5, 3,
                                                                      ifelse(dif <= 1 & dif >= -1, 4,
                                                                          ifelse(dif  <= 5 & dif > 1, 5, 
                                                                                 ifelse(dif <= 10 & dif > 5, 6, 7
                                                                                 )))))))
                                 


contsmall(sex_data, sex_data$dif_cat, "Own Age - Partner Age", "")

Want - Age Difference

reg_just_mod_i(sex_data$want, sex_data, sex_data$dif, "Own Age - Partner Age")
Estimate Std. Error t_value p_value
Intercept 28.9078666 0.2359541 122.515 0
Married: True -5.0575833 0.2803994 -18.037 0
Own Age - Partner Age 0.0374872 0.0180943 2.072 0.0383

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$dif, "Own Age - Partner Age")
Estimate Std. Error t_value p_value
Intercept 34.0394728 0.3792510 89.754 0
Married: True -2.3508670 0.2848575 -8.253 0
Own Age - Partner Age 0.0633540 0.0188267 3.365 8e-04
Age (years) -0.1865549 0.0082503 -22.612 0
Duration -0.0147545 0.0050005 -2.951 0.0032
Male 4.2562491 0.2572687 16.544 0

Like - Age Difference

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$dif,"Own Age - Partner Age")
Estimate Std. Error t_value p_value
Intercept 38.4936517 0.2655207 144.974 0
Married: True -3.9461633 0.3166001 -12.464 0
Own Age - Partner Age 0.0580273 0.0205295 2.827 0.0047

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$dif, "Own Age - Partner Age")
Estimate Std. Error t_value p_value
Intercept 41.4568818 0.4576758 90.581 0
Married: True -2.5494021 0.3425991 -7.441 0
Own Age - Partner Age 0.0900794 0.0227706 3.956 1e-04
Age (years) -0.0961261 0.0099630 -9.648 0
Duration -0.0076745 0.0059133 -1.298 0.1944
Male 1.4971609 0.3113452 4.809 0

Frequency - Age Difference

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$dif, "Own Age - Partner Age")
Estimate Std. Error t_value p_value
Intercept 3.6675712 0.0408555 89.769 0
Married: True -0.6602885 0.0480726 -13.735 0
Own Age - Partner Age -0.0058926 0.0030720 -1.918 0.0552

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$dif, "Own Age - Partner Age")
Estimate Std. Error t_value p_value
Intercept 4.9779925 0.0672407 74.032 0
Married: True -0.1265578 0.0489196 -2.587 0.0097
Own Age - Partner Age 0.0164814 0.0032074 5.139 0
Age (years) -0.0356801 0.0014865 -24.003 0
Duration -0.0024071 0.0010886 -2.211 0.0271
Male 0.1605635 0.0434115 3.699 2e-04

Religion - There is some interesting stuff here so I’m going to wait until after call to analyze. Does’t account for marriage effect nonetheless

Frequency – Full Controls

sex_data %>% 
  lm(want ~ married + religion, data = .) %>%
  summary()
## 
## Call:
## lm(formula = want ~ married + religion, data = .)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -23.4643  -5.9643   0.1145   6.3976  22.4408 
## 
## Coefficients:
##                                                              Estimate
## (Intercept)                                                  28.67394
## marriedTRUE                                                  -5.07878
## religionProtestant (United, Anglican, Presbyterian, Baptist) -0.01831
## religionJewish                                                0.67898
## religionMuslim                                                2.43371
## religionHindu                                                 0.92838
## religionNone or Atheist or Agnostic                          -1.03592
## religionOther                                                 2.31537
##                                                              Std. Error
## (Intercept)                                                     0.45838
## marriedTRUE                                                     0.32525
## religionProtestant (United, Anglican, Presbyterian, Baptist)    0.46261
## religionJewish                                                  0.90977
## religionMuslim                                                  1.75232
## religionHindu                                                   2.48919
## religionNone or Atheist or Agnostic                             0.61280
## religionOther                                                   0.50644
##                                                              t value
## (Intercept)                                                   62.555
## marriedTRUE                                                  -15.615
## religionProtestant (United, Anglican, Presbyterian, Baptist)  -0.040
## religionJewish                                                 0.746
## religionMuslim                                                 1.389
## religionHindu                                                  0.373
## religionNone or Atheist or Agnostic                           -1.690
## religionOther                                                  4.572
##                                                              Pr(>|t|)    
## (Intercept)                                                    <2e-16 ***
## marriedTRUE                                                    <2e-16 ***
## religionProtestant (United, Anglican, Presbyterian, Baptist)    0.968    
## religionJewish                                                  0.456    
## religionMuslim                                                  0.165    
## religionHindu                                                   0.709    
## religionNone or Atheist or Agnostic                             0.091 .  
## religionOther                                                   5e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.853 on 3622 degrees of freedom
##   (1445 observations deleted due to missingness)
## Multiple R-squared:  0.07993,    Adjusted R-squared:  0.07815 
## F-statistic: 44.95 on 7 and 3622 DF,  p-value: < 2.2e-16
sex_data %>% 
  lm(totlike ~ married + religion, data = .) %>%
  summary()
## 
## Call:
## lm(formula = totlike ~ married + religion, data = .)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -29.598  -6.693   1.330   8.375  16.944 
## 
## Coefficients:
##                                                              Estimate
## (Intercept)                                                  38.46321
## marriedTRUE                                                  -3.92725
## religionProtestant (United, Anglican, Presbyterian, Baptist)  0.08888
## religionJewish                                               -0.19173
## religionMuslim                                                1.23711
## religionHindu                                                -1.12337
## religionNone or Atheist or Agnostic                          -1.47959
## religionOther                                                 1.13424
##                                                              Std. Error
## (Intercept)                                                     0.51282
## marriedTRUE                                                     0.36388
## religionProtestant (United, Anglican, Presbyterian, Baptist)    0.51756
## religionJewish                                                  1.01783
## religionMuslim                                                  1.96047
## religionHindu                                                   2.78487
## religionNone or Atheist or Agnostic                             0.68559
## religionOther                                                   0.56660
##                                                              t value
## (Intercept)                                                   75.003
## marriedTRUE                                                  -10.793
## religionProtestant (United, Anglican, Presbyterian, Baptist)   0.172
## religionJewish                                                -0.188
## religionMuslim                                                 0.631
## religionHindu                                                 -0.403
## religionNone or Atheist or Agnostic                           -2.158
## religionOther                                                  2.002
##                                                              Pr(>|t|)    
## (Intercept)                                                    <2e-16 ***
## marriedTRUE                                                    <2e-16 ***
## religionProtestant (United, Anglican, Presbyterian, Baptist)   0.8637    
## religionJewish                                                 0.8506    
## religionMuslim                                                 0.5281    
## religionHindu                                                  0.6867    
## religionNone or Atheist or Agnostic                            0.0310 *  
## religionOther                                                  0.0454 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.905 on 3622 degrees of freedom
##   (1445 observations deleted due to missingness)
## Multiple R-squared:  0.03599,    Adjusted R-squared:  0.03413 
## F-statistic: 19.32 on 7 and 3622 DF,  p-value: < 2.2e-16

Having Children In House Seems Promising, But Not Nearly Enough Data

Want

sex_data <-sex_data  %>% mutate(children_in_house = ifelse(children == "Yes, my partner and I have 1 or more children under the age of 18 that live with me/my partner all of the time", 1, 0))


bin_graphs_want(sex_data, as.factor(sex_data$children_in_house), "Children In House", c("Children", "No Children"),  
                     c("Unmarried, Children", "Married, Children", "Unmarried, No Children", "Married, No Children"))

Like Graphs

bin_graphs_like(sex_data, as.factor(sex_data$children_in_house), "Children In House", c("Children", "No Children"),  
                     c("Unmarried, Children", "Married, Children", "Unmarried, No Children", "Married, No Children"))

Frequency Graphs

bin_graphs_freq(sex_data, as.factor(sex_data$children_in_house), "Children In House", c("Children", "No Children"),  
                     c("Unmarried, Children", "Married, Children", "Unmarried, No Children", "Married, No Children"))

Want - Children

reg_just_mod_i(sex_data$want, sex_data, sex_data$children_in_house, "Has Children In House")
Estimate Std. Error t_value p_value
Intercept 27.2613340 1.134890 24.021 0
Married: True -1.3197076 1.798587 -0.734 0.4663
Has Children In House 0.4213146 2.205528 0.191 0.8492

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$children_in_house, "Has Children In House")
Estimate Std. Error t_value p_value
Intercept 28.2289203 3.4994587 8.067 0
Married: True -2.1847248 2.1088725 -1.036 0.3051
Has Children In House 0.6597606 2.0966675 0.315 0.7543
Age (years) -0.1090315 0.1243599 -0.877 0.3847
Duration 0.0366755 0.1776905 0.206 0.8373
Male 5.3815719 1.5267409 3.525 9e-04

Like - Children In Houise

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$children_in_house,"Has Children In House")
Estimate Std. Error t_value p_value
Intercept 36.291123 1.379154 26.314 0
Married: True -1.652972 2.185700 -0.756 0.4528
Has Children In House 1.557435 2.680227 0.581 0.5636

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$children_in_house, "Has Children In House")
Estimate Std. Error t_value p_value
Intercept 38.0384981 4.5673762 8.328 0
Married: True -0.6739723 2.7524297 -0.245 0.8075
Has Children In House 1.9184509 2.7365002 0.701 0.4865
Age (years) -0.0962328 0.1623103 -0.593 0.5559
Duration -0.1560996 0.2319157 -0.673 0.5039
Male 3.4260734 1.9926510 1.719 0.0916

Frequency - Children In House

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$children_in_house, "Has Children In House")
Estimate Std. Error t_value p_value
Intercept 3.8571923 0.1571327 24.547 0
Married: True -0.0505453 0.2434290 -0.208 0.8363
Has Children In House -0.1441925 0.2946513 -0.489 0.6266

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$children_in_house, "Has Children In House")
Estimate Std. Error t_value p_value
Intercept 4.3420304 0.5181018 8.381 0
Married: True -0.0072073 0.3138191 -0.023 0.9818
Has Children In House -0.0652540 0.3097394 -0.211 0.834
Age (years) -0.0181816 0.0184045 -0.988 0.3281
Duration 0.0012913 0.0262512 0.049 0.961
Male 0.0629352 0.2296261 0.274 0.7852