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){
  

  
  df2 = df[!is.na(df$totlike) & !is.na(mod),]
  mod = mod[!is.na(df$totlike) & !is.na(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, aes(color = married)) + jrothsch_theme +
  labs(title = paste0("Interaction between marriage and ", modname ), 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, 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

Monotony – Negative Effect, No Clear Interaction With Marriege

Graphs

sex_data$MonoNum = as.numeric(sex_data$satis5)

contsmall(sex_data, sex_data$MonoNum, "Monotony", "")

Want - Only Monotony

reg_just_mod_i(sex_data$want, sex_data, sex_data$MonoNum, "Monotony")
Estimate Std. Error t_value p_value
Intercept 29.5259136 0.3511769 84.077 0
Married: True -4.9183274 0.2844883 -17.288 0
Monotony -0.2051366 0.0927987 -2.211 0.0271

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$MonoNum, "Monotony")
Estimate Std. Error t_value p_value
Intercept 35.5128795 0.4728986 75.096 0
Married: True -2.3731787 0.2860717 -8.296 0
Monotony -0.5559344 0.0873297 -6.366 0
Age (years) -0.1857905 0.0081737 -22.73 0
Duration -0.0148084 0.0049804 -2.973 0.003
Male 4.4861607 0.2468294 18.175 0

Like - Only Monotony

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$MonoNum, "Monotony")
Estimate Std. Error t_value p_value
Intercept 42.784049 0.3820126 111.996 0
Married: True -4.227152 0.3098335 -13.643 0
Monotony -1.535484 0.1011579 -15.179 0

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$MonoNum, "Monotony")
Estimate Std. Error t_value p_value
Intercept 46.9634370 0.5466499 85.911 0
Married: True -2.6328889 0.3306209 -7.963 0
Monotony -1.7679711 0.1010195 -17.501 0
Age (years) -0.1154494 0.0094498 -12.217 0
Duration -0.0074340 0.0057137 -1.301 0.1933
Male 1.8702236 0.2852568 6.556 0

Frequency - Only Monotony

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$MonoNum, "Monotony")
Estimate Std. Error t_value p_value
Intercept 3.7307217 0.0597737 62.414 0
Married: True -0.6360546 0.0485138 -13.111 0
Monotony -0.0197453 0.0157821 -1.251 0.211

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$MonoNum, "Monotony")
Estimate Std. Error t_value p_value
Intercept 5.1952864 0.0820679 63.305 0
Married: True -0.1445071 0.0489517 -2.952 0.0032
Monotony -0.0971658 0.0148454 -6.545 0
Age (years) -0.0345372 0.0014561 -23.719 0
Duration -0.0027521 0.0010713 -2.569 0.0102
Male 0.2256946 0.0415652 5.43 0

Fantasy Of Other Partner – Strong Negative Effect, No Clear Interaction With Marriege

Graphs

sex_data$OtherNum = as.numeric(sex_data$satis14)

contsmall(sex_data, sex_data$OtherNum, "Fantasize About Other Sex Partner", "")

Want - Only Monotony

reg_just_mod_i(sex_data$want, sex_data, sex_data$OtherNum, "Fantasy Other Partner")
Estimate Std. Error t_value p_value
Intercept 30.2063690 0.3359159 89.922 0
Married: True -4.9715910 0.2852515 -17.429 0
Fantasy Other Partner -0.7041937 0.1449588 -4.858 0

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$OtherNum, "Fantasy Other Partner")
Estimate Std. Error t_value p_value
Intercept 35.7117038 0.4340663 82.272 0
Married: True -2.5159268 0.2866776 -8.776 0
Fantasy Other Partner -1.2303163 0.1353922 -9.087 0
Age (years) -0.1810275 0.0080917 -22.372 0
Duration -0.0136193 0.0049551 -2.749 0.006
Male 4.8201704 0.2499502 19.285 0

Like - Only Monotony

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$OtherNum, "Fantasy Other Partner")
Estimate Std. Error t_value p_value
Intercept 43.273313 0.3602976 120.104 0
Married: True -4.242085 0.3059558 -13.865 0
Fantasy Other Partner -2.913021 0.1554803 -18.736 0

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$OtherNum, "Fantasy Other Partner")
Estimate Std. Error t_value p_value
Intercept 46.4198309 0.4944105 93.889 0
Married: True -2.8816458 0.3265317 -8.825 0
Fantasy Other Partner -3.2163329 0.1542145 -20.856 0
Age (years) -0.1039780 0.0092167 -11.282 0
Duration -0.0051358 0.0056440 -0.91 0.3629
Male 2.7726414 0.2846984 9.739 0

Frequency - Only Monotony

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$OtherNum, "Fantasy Other Partner")
Estimate Std. Error t_value p_value
Intercept 3.7295288 0.0573182 65.067 0
Married: True -0.6361004 0.0485324 -13.107 0
Fantasy Other Partner -0.0219594 0.0248557 -0.883 0.377

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$OtherNum, "Fantasy Other Partner")
Estimate Std. Error t_value p_value
Intercept 4.9729976 0.0756913 65.701 0
Married: True -0.1628016 0.0493060 -3.302 0.001
Fantasy Other Partner -0.0748040 0.0233300 -3.206 0.0014
Age (years) -0.0324980 0.0014478 -22.447 0
Duration -0.0028291 0.0010725 -2.638 0.0084
Male 0.2498086 0.0422698 5.91 0

Hurried Sex - Strongly Harms Like, Doesn’t Change Marriage Much

Graphs

sex_data$HurryNum = as.numeric(sex_data$satis16)

contsmall(sex_data, sex_data$HurryNum, "Sex Completed Too Hurriedly", "")

Want - Only Hurry

reg_just_mod_i(sex_data$want, sex_data, sex_data$HurryNum, "Too Quick")
Estimate Std. Error t_value p_value
Intercept 30.275498 0.3397738 89.105 0
Married: True -4.821224 0.2852910 -16.899 0
Too Quick -0.570011 0.1132467 -5.033 0

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$HurryNum, "Too Quick")
Estimate Std. Error t_value p_value
Intercept 35.9840531 0.4513280 79.729 0
Married: True -2.1978202 0.2878586 -7.635 0
Too Quick -0.9559470 0.1055536 -9.057 0
Age (years) -0.1844556 0.0081382 -22.665 0
Duration -0.0137789 0.0049548 -2.781 0.0054
Male 4.6001122 0.2475807 18.58 0

Like - Only Hurry

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$HurryNum, "Too Quick")
Estimate Std. Error t_value p_value
Intercept 44.248025 0.3591588 123.199 0
Married: True -3.574343 0.3015677 -11.853 0
Too Quick -2.680510 0.1197077 -22.392 0

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$HurryNum, "Too Quick")
Estimate Std. Error t_value p_value
Intercept 48.1806020 0.5054212 95.328 0
Married: True -1.9419931 0.3223594 -6.024 0
Too Quick -2.9202466 0.1182045 -24.705 0
Age (years) -0.1176091 0.0091136 -12.905 0
Duration -0.0048224 0.0055486 -0.869 0.3848
Male 2.2470082 0.2772541 8.105 0

Frequency - Only Hurry

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$HurryNum, "Too Quick")
Estimate Std. Error t_value p_value
Intercept 3.7815070 0.0576402 65.605 0
Married: True -0.6274247 0.0485768 -12.916 0
Too Quick -0.0413275 0.0191751 -2.155 0.0312

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$HurryNum, "Too Quick")
Estimate Std. Error t_value p_value
Intercept 5.1187966 0.0784816 65.223 0
Married: True -0.1291410 0.0494262 -2.613 0.009
Too Quick -0.1092619 0.0179364 -6.092 0
Age (years) -0.0333392 0.0014525 -22.953 0
Duration -0.0026991 0.0010694 -2.524 0.0116
Male 0.2424752 0.0417810 5.803 0

Distracted during - Strong Negative Effect, Doesn’t Change Marriage Much

Graphs

sex_data$DistractNum = as.numeric(sex_data$satis18)

contsmall(sex_data, sex_data$DistractNum, "Gets Distracted", "")

Want - Only Distracted

reg_just_mod_i(sex_data$want, sex_data, sex_data$DistractNum, "Gets Distracted")
Estimate Std. Error t_value p_value
Intercept 32.172881 0.3311453 97.156 0
Married: True -5.055033 0.2805466 -18.019 0
Gets Distracted -1.545575 0.1158295 -13.344 0

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$DistractNum, "Gets Distracted")
Estimate Std. Error t_value p_value
Intercept 38.0551853 0.4521564 84.164 0
Married: True -2.3906136 0.2812337 -8.5 0
Gets Distracted -1.7687953 0.1086924 -16.273 0
Age (years) -0.1922949 0.0079836 -24.086 0
Duration -0.0128899 0.0048612 -2.652 0.008
Male 4.0684648 0.2439992 16.674 0

Like - Only Distracted

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$DistractNum, "Gets Distracted")
Estimate Std. Error t_value p_value
Intercept 44.716559 0.3515265 127.207 0
Married: True -4.258508 0.2978136 -14.299 0
Gets Distracted -3.072837 0.1229585 -24.991 0

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$DistractNum, "Gets Distracted")
Estimate Std. Error t_value p_value
Intercept 49.2125749 0.5106058 96.381 0
Married: True -2.5933206 0.3175883 -8.166 0
Gets Distracted -3.2994353 0.1227429 -26.881 0
Age (years) -0.1196268 0.0090157 -13.269 0
Duration -0.0051364 0.0054896 -0.936 0.3495
Male 1.1212549 0.2755405 4.069 0

Frequency - Only Distracted

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$DistractNum, "Gets Distracted")
Estimate Std. Error t_value p_value
Intercept 3.7240482 0.0572071 65.098 0
Married: True -0.6355050 0.0485176 -13.098 0
Gets Distracted -0.0149976 0.0200057 -0.75 0.4535

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$DistractNum, "Gets Distracted")
Estimate Std. Error t_value p_value
Intercept 5.0677481 0.0803318 63.085 0
Married: True -0.1550681 0.0492552 -3.148 0.0017
Gets Distracted -0.0877909 0.0189700 -4.628 0
Age (years) -0.0330110 0.0014538 -22.707 0
Duration -0.0027907 0.0010711 -2.605 0.0092
Male 0.2069520 0.0421376 4.911 0

Tries New Things – Massive Effect, Decimates Marriage Effect

Graphs

sex_data$NewNum = as.numeric(sex_data$satis24)

contsmall(sex_data, sex_data$NewNum, "Tries New Things", "")

Want - Only New

reg_just_mod_i(sex_data$want, sex_data, sex_data$NewNum, "New")
Estimate Std. Error t_value p_value
Intercept 17.277493 0.3635358 47.526 0
Married: True -2.457230 0.2549766 -9.637 0
New 3.485618 0.0883668 39.445 0

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$NewNum, "New")
Estimate Std. Error t_value p_value
Intercept 20.9415194 0.4754371 44.047 0
Married: True -1.0224475 0.2577227 -3.967 1e-04
New 3.1395434 0.0857641 36.607 0
Age (years) -0.1153445 0.0073363 -15.722 0
Duration -0.0158141 0.0044020 -3.592 3e-04
Male 4.1302188 0.2200485 18.77 0

Like - Only New

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$NewNum, "New")
Estimate Std. Error t_value p_value
Intercept 21.4035724 0.3518714 60.828 0
Married: True -0.4013391 0.2467954 -1.626 0.104
New 5.0655671 0.0855314 59.225 0

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$NewNum, "New")
Estimate Std. Error t_value p_value
Intercept 20.4167057 0.4852004 42.079 0
Married: True -0.3920576 0.2630151 -1.491 0.1361
New 5.0809793 0.0875253 58.052 0
Age (years) 0.0094618 0.0074870 1.264 0.2064
Duration -0.0104979 0.0044924 -2.337 0.0195
Male 1.3246685 0.2245672 5.899 0

Frequency - Only New

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$NewNum, "New")
Estimate Std. Error t_value p_value
Intercept 2.2343526 0.0652348 34.251 0
Married: True -0.3344510 0.0461251 -7.251 0
New 0.4410455 0.0160447 27.489 0

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$NewNum, "New")
Estimate Std. Error t_value p_value
Intercept 3.4179222 0.0860175 39.735 0
Married: True 0.0062303 0.0470354 0.132 0.8946
New 0.3676306 0.0155445 23.65 0
Age (years) -0.0261641 0.0013851 -18.889 0
Duration -0.0025752 0.0010116 -2.546 0.0109
Male 0.1880966 0.0395304 4.758 0

Interesting/Mysterious Partner – Accounts For Part Of Marriage Effect

Graphs

sex_data$MystNum = as.numeric(sex_data$satis25)

contsmall(sex_data, sex_data$MystNum, "Partner Mysterious and Interesting", "")

Want - Only Partner Interesting

reg_just_mod_i(sex_data$want, sex_data, sex_data$MystNum, "Interesting")
Estimate Std. Error t_value p_value
Intercept 21.435459 0.3580187 59.872 0
Married: True -3.327966 0.2716355 -12.252 0
Interesting 2.647642 0.0974496 27.169 0

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$MystNum, "Interesting")
Estimate Std. Error t_value p_value
Intercept 26.2125777 0.4601101 56.97 0
Married: True -1.4323576 0.2750976 -5.207 0
Interesting 2.2809680 0.0928068 24.578 0
Age (years) -0.1456037 0.0077300 -18.836 0
Duration -0.0164465 0.0046997 -3.499 5e-04
Male 3.9779383 0.2356056 16.884 0

Like - Only Partner Interesting

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$MystNum, "Interesting")
Estimate Std. Error t_value p_value
Intercept 29.254788 0.3908048 74.858 0
Married: True -2.040204 0.2965110 -6.881 0
Interesting 3.219601 0.1063737 30.267 0

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$MystNum, "Interesting")
Estimate Std. Error t_value p_value
Intercept 30.8720969 0.5316977 58.063 0
Married: True -1.3186588 0.3178995 -4.148 0
Interesting 3.0974577 0.1072464 28.882 0
Age (years) -0.0468673 0.0089327 -5.247 0
Duration -0.0112585 0.0054310 -2.073 0.0382
Male 1.2109024 0.2722630 4.448 0

Frequency - Only Partner Interesting

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$MystNum, "Interesting")
Estimate Std. Error t_value p_value
Intercept 2.9456605 0.0633786 46.477 0
Married: True -0.4839334 0.0482961 -10.02 0
Interesting 0.2655542 0.0174524 15.216 0

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$MystNum, "Interesting")
Estimate Std. Error t_value p_value
Intercept 4.1953493 0.0820903 51.106 0
Married: True -0.0717980 0.0489997 -1.465 0.1429
Interesting 0.2088167 0.0165309 12.632 0
Age (years) -0.0299742 0.0014304 -20.954 0
Duration -0.0026900 0.0010549 -2.55 0.0108
Male 0.1867203 0.0413268 4.518 0

Interesting/Mysterious Partner – Accounts For Part Of Marriage Effect

Graphs

sex_data$DiscNewNum = as.numeric(sex_data$satis26)

contsmall(sex_data, sex_data$DiscNewNum, "Discovers New Things About Partner", "")

Want - Only Discovering

reg_just_mod_i(sex_data$want, sex_data, sex_data$DiscNewNum, "Discovering")
Estimate Std. Error t_value p_value
Intercept 19.015735 0.3619703 52.534 0
Married: True -2.747458 0.2626967 -10.459 0
Discovering 3.137622 0.0912593 34.381 0

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$DiscNewNum, "Discovering")
Estimate Std. Error t_value p_value
Intercept 23.3240442 0.4646886 50.193 0
Married: True -1.0989919 0.2652105 -4.144 0
Discovering 2.7911754 0.0873766 31.944 0
Age (years) -0.1337139 0.0074652 -17.912 0
Duration -0.0133074 0.0045246 -2.941 0.0033
Male 4.0860144 0.2262791 18.057 0

Like - Only Discovering

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$DiscNewNum, "Discovering")
Estimate Std. Error t_value p_value
Intercept 25.108310 0.3779806 66.428 0
Married: True -1.075977 0.2743160 -3.922 1e-04
Discovering 4.191605 0.0952958 43.985 0

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$DiscNewNum, "Discovering")
Estimate Std. Error t_value p_value
Intercept 25.7549054 0.5139211 50.115 0
Married: True -0.7097562 0.2933089 -2.42 0.0156
Discovering 4.1146860 0.0966340 42.58 0
Age (years) -0.0260560 0.0082561 -3.156 0.0016
Duration -0.0067482 0.0050040 -1.349 0.1775
Male 1.3110139 0.2502528 5.239 0

Frequency - Only Discovering

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$DiscNewNum, "Discovering")
Estimate Std. Error t_value p_value
Intercept 2.7055783 0.0657384 41.157 0
Married: True -0.4229947 0.0480013 -8.812 0
Discovering 0.3144845 0.0167285 18.799 0

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$DiscNewNum, "Discovering")
Estimate Std. Error t_value p_value
Intercept 3.9637027 0.0849400 46.665 0
Married: True -0.0420060 0.0486551 -0.863 0.388
Discovering 0.2488899 0.0159668 15.588 0
Age (years) -0.0291566 0.0014203 -20.528 0
Duration -0.0022667 0.0010459 -2.167 0.0303
Male 0.1941551 0.0408757 4.75 0

Intellectually Stimulating – Strongly Reduces Marriage Effect

Graphs

sex_data$IntNum = as.numeric(sex_data$intellectualstim)

contsmall(sex_data, sex_data$IntNum, "Intellectually Stimulating Partner", "")

Want - Only Intellectually stimulating

reg_just_mod_i(sex_data$want, sex_data, sex_data$IntNum, "Intellectually Stimulating")
Estimate Std. Error t_value p_value
Intercept 16.194569 0.4892062 33.104 0
Married: True -4.686088 0.2627498 -17.835 0
Intellectually Stimulating 2.294247 0.0778895 29.455 0

Want – Full Controls

reg_full_control(sex_data$want, sex_data, sex_data$IntNum, "Intellectually Stimulating")
Estimate Std. Error t_value p_value
Intercept 20.9372811 0.5386318 38.871 0
Married: True -2.4122527 0.2648919 -9.107 0
Intellectually Stimulating 2.1794216 0.0721333 30.214 0
Age (years) -0.1600354 0.0074552 -21.466 0
Duration -0.0158778 0.0045697 -3.475 5e-04
Male 4.3161638 0.2285628 18.884 0

Like - Only Intellectually Stimuating

reg_just_mod_i(sex_data$totlike, sex_data, sex_data$IntNum, "Intellectually Stimulating")
Estimate Std. Error t_value p_value
Intercept 17.513912 0.4800842 36.481 0
Married: True -3.605761 0.2578504 -13.984 0
Intellectually Stimulating 3.745942 0.0764371 49.007 0

Like – Full Controls

reg_full_control(sex_data$totlike,sex_data, sex_data$IntNum, "Intellectually Stimulating")
Estimate Std. Error t_value p_value
Intercept 19.4060631 0.5650010 34.347 0
Married: True -2.6414464 0.2778599 -9.506 0
Intellectually Stimulating 3.6999956 0.0756647 48.9 0
Age (years) -0.0622205 0.0078201 -7.956 0
Duration -0.0104218 0.0047934 -2.174 0.0297
Male 1.6438567 0.2397523 6.856 0

Frequency - Only Intellectually Stimulating

reg_just_mod_i(sex_data$freq_num, sex_data, sex_data$IntNum, "Intellectually Stimulating")
Estimate Std. Error t_value p_value
Intercept 2.4224503 0.0863825 28.043 0
Married: True -0.6075684 0.0470778 -12.906 0
Intellectually Stimulating 0.2277971 0.0137416 16.577 0

Frequency – Full Controls

reg_full_control(sex_data$freq_num, sex_data, sex_data$IntNum, "Intellectually Stimulating")
Estimate Std. Error t_value p_value
Intercept 3.6439135 0.0968524 37.623 0
Married: True -0.1499368 0.0479399 -3.128 0.0018
Intellectually Stimulating 0.2089352 0.0128012 16.322 0
Age (years) -0.0308807 0.0014053 -21.975 0
Duration -0.0028770 0.0010416 -2.762 0.0058
Male 0.2048077 0.0407177 5.03 0