Proposal Script

STEP1: Bringing data

library(rio)
lkData = "https://github.com/AriannaNKZC/UniMaGenderStudies/blob/main/data_gender_studies_fin.xlsx?raw=true"
data=import(lkData)
data$`Same Sex Marriage`
##   [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
##  [38] 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0
##  [75] 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0
## [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [186] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [223] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
## [260] 0

STEP2: Exploring how is data distribution by making a graphic

library(ggplot2)
ggplot(data, aes(x = Year, fill = factor(`Same Sex Marriage`))) +
        ylab("Number of Latin-American Countries") +
        geom_bar(stat = "count") +
        scale_fill_discrete(name = "Acceptance of Same Sex Marriage",
                       labels = c("no", "yes"))

This indicates that there has been an increase in Latin American countries recognizing same-sex marriage in the last 12 years.

Lets change one name variable to make it easier to work witk

names(data)[3] = "sexmarriage"
names(data)[6] = "USA"

STEP 2: Logistic regresion

Binominal variable

Hypothesis one

H1. The odds of a Latin-America country legalizing same-sex marriage increase when critical countries have a high index of LGBT legislation.

Consideration of critical countries

set.seed(2019)
#first model  - considering just Spain
rlog1 <- glm(sexmarriage ~ Spain, data = data, family = 'binomial')

#second model - considering just Portugal
rlog2 <- glm(sexmarriage ~ Portugal, data = data, family = 'binomial')

#third model - considering just France
rlog3 <- glm(sexmarriage ~ France, data = data, family = 'binomial')

#fourth model - considering just Germany
rlog4 <- glm(sexmarriage ~ Germany, data = data, family = 'binomial')

#fifht model = considering just USA
rlog5 <- glm(sexmarriage ~ USA, data = data, family = 'binomial')

#sixth model = considering just China
rlog6 <- glm(sexmarriage ~ China, data = data, family = 'binomial')

#seventh model = considering just Brazil
rlog7 <- glm(sexmarriage ~ Brazil, data = data, family = 'binomial')

#eight model = considering just Argentina
rlog8 <- glm(sexmarriage ~ Argentina, data = data, family = 'binomial')

#nine model - the aggrupation one

rlog9 <- glm(sexmarriage ~ Spain + Portugal + France + Germany + USA + China + Brazil + Argentina, data = data, family = 'binomial')

rlog91 <- glm(sexmarriage ~ Spain + Portugal + France + Germany + USA + Brazil + Argentina, data = data, family = 'binomial')
#a nicer way to see the models
library(stargazer)
## 
## Please cite as:
##  Hlavac, Marek (2018). stargazer: Well-Formatted Regression and Summary Statistics Tables.
##  R package version 5.2.2. https://CRAN.R-project.org/package=stargazer

to see as group

stargazer(rlog9, rlog91, type="text")
## 
## ==============================================
##                       Dependent variable:     
##                   ----------------------------
##                           sexmarriage         
##                        (1)            (2)     
## ----------------------------------------------
## Spain                 0.040          0.034    
##                      (0.059)        (0.053)   
##                                               
## Portugal              -0.126        -0.102    
##                      (0.186)        (0.160)   
##                                               
## France                0.015          0.018    
##                      (0.052)        (0.051)   
##                                               
## Germany               -0.106        -0.077    
##                      (0.185)        (0.145)   
##                                               
## USA                   0.052          0.051    
##                      (0.069)        (0.069)   
##                                               
## China                 0.018                   
##                      (0.072)                  
##                                               
## Brazil                0.063          0.053    
##                      (0.092)        (0.083)   
##                                               
## Argentina             0.003          0.002    
##                      (0.091)        (0.091)   
##                                               
## Constant              3.515          1.129    
##                      (18.741)      (16.198)   
##                                               
## ----------------------------------------------
## Observations           260            260     
## Log Likelihood       -117.612      -117.644   
## Akaike Inf. Crit.    253.223        251.287   
## ==============================================
## Note:              *p<0.1; **p<0.05; ***p<0.01

to see individually

stargazer(rlog1,rlog2, rlog3, rlog4, rlog5, rlog6, rlog7, rlog8, type="text")
## 
## ===================================================================================================
##                                                  Dependent variable:                               
##                   ---------------------------------------------------------------------------------
##                                                      sexmarriage                                   
##                      (1)       (2)        (3)       (4)       (5)       (6)       (7)       (8)    
## ---------------------------------------------------------------------------------------------------
## Spain             0.084***                                                                         
##                    (0.030)                                                                         
##                                                                                                    
## Portugal                     0.150***                                                              
##                              (0.042)                                                               
##                                                                                                    
## France                                 0.071***                                                    
##                                         (0.018)                                                    
##                                                                                                    
## Germany                                          0.093***                                          
##                                                   (0.023)                                          
##                                                                                                    
## USA                                                        0.040***                                
##                                                             (0.010)                                
##                                                                                                    
## China                                                                0.060***                      
##                                                                       (0.016)                      
##                                                                                                    
## Brazil                                                                         0.062***            
##                                                                                 (0.015)            
##                                                                                                    
## Argentina                                                                                 0.144*** 
##                                                                                           (0.038)  
##                                                                                                    
## Constant          -8.047*** -14.198*** -7.048*** -9.417*** -4.625*** -4.318*** -6.539*** -12.905***
##                    (2.378)   (3.646)    (1.497)   (1.974)   (0.878)   (0.829)   (1.274)   (3.041)  
##                                                                                                    
## ---------------------------------------------------------------------------------------------------
## Observations         260       260        260       260       260       260       260       260    
## Log Likelihood    -125.057   -120.711  -118.555  -119.601  -119.474  -120.836  -119.144   -119.737 
## Akaike Inf. Crit.  254.114   245.422    241.109   243.201   242.948   245.672   242.289   243.474  
## ===================================================================================================
## Note:                                                                   *p<0.1; **p<0.05; ***p<0.01

hypothesis 2

H2. The odds of a Latin-America country legalizing same-sex marriage increased when Spain and Portugal had a high index of LGBT legislation.

Consideration of Spain and Portugal

log1 <- glm(sexmarriage ~ Spain + Portugal, data = data, family = 'binomial')
stargazer(rlog1,rlog2, log1, type="text")
## 
## =================================================
##                         Dependent variable:      
##                   -------------------------------
##                             sexmarriage          
##                      (1)       (2)        (3)    
## -------------------------------------------------
## Spain             0.084***               0.051   
##                    (0.030)              (0.031)  
##                                                  
## Portugal                     0.150***   0.132*** 
##                              (0.042)    (0.043)  
##                                                  
## Constant          -8.047*** -14.198*** -16.637***
##                    (2.378)   (3.646)    (3.865)  
##                                                  
## -------------------------------------------------
## Observations         260       260        260    
## Log Likelihood    -125.057   -120.711   -119.440 
## Akaike Inf. Crit.  254.114   245.422    244.881  
## =================================================
## Note:                 *p<0.1; **p<0.05; ***p<0.01

hypothesis 3

H3. The odds of a Latin-America country legalizing same-sex marriage increased when the United States and China had a high index of LGBT legislation since they are superpowers.

hypothesis 4

H4. The odds of a Latin-America country legalizing same-sex marriage increased when the United States had a high index of LGBT legislation since they are superpowers.

Consideration of superpowers (China & US) and US

log2 <- glm(sexmarriage ~ USA + China, data = data, family = 'binomial')
stargazer(rlog5,log2, type="text")
## 
## ==============================================
##                       Dependent variable:     
##                   ----------------------------
##                           sexmarriage         
##                        (1)            (2)     
## ----------------------------------------------
## USA                  0.040***       0.049*    
##                      (0.010)        (0.029)   
##                                               
## China                               -0.015    
##                                     (0.046)   
##                                               
## Constant            -4.625***      -4.609***  
##                      (0.878)        (0.886)   
##                                               
## ----------------------------------------------
## Observations           260            260     
## Log Likelihood       -119.474      -119.417   
## Akaike Inf. Crit.    242.948        244.835   
## ==============================================
## Note:              *p<0.1; **p<0.05; ***p<0.01

hypothesis 5

H5. The odds of a Latin-America country legalizing same-sex marriage increased when Argentina and Brazil had a high index of LGBT legislation since they are superpowers.

Consideration of Latinoamerican countries (Argentina and Brazil)

log3 <- glm(sexmarriage ~ Brazil + Argentina, data = data, family = 'binomial')
stargazer(rlog7, rlog8, log3, type="text")
## 
## ================================================
##                        Dependent variable:      
##                   ------------------------------
##                            sexmarriage          
##                      (1)       (2)        (3)   
## ------------------------------------------------
## Brazil            0.062***               0.040  
##                    (0.015)              (0.027) 
##                                                 
## Argentina                    0.144***    0.062  
##                              (0.038)    (0.064) 
##                                                 
## Constant          -6.539*** -12.905*** -9.648***
##                    (1.274)   (3.041)    (3.537) 
##                                                 
## ------------------------------------------------
## Observations         260       260        260   
## Log Likelihood    -119.144   -119.737  -118.658 
## Akaike Inf. Crit.  242.289   243.474    243.317 
## ================================================
## Note:                *p<0.1; **p<0.05; ***p<0.01