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",report=("vc*p"))
## 
## ==============================================
##                       Dependent variable:     
##                   ----------------------------
##                           sexmarriage         
##                        (1)            (2)     
## ----------------------------------------------
## Spain                 0.040          0.034    
##                     p = 0.498      p = 0.530  
##                                               
## Portugal              -0.126        -0.102    
##                     p = 0.500      p = 0.525  
##                                               
## France                0.015          0.018    
##                     p = 0.773      p = 0.727  
##                                               
## Germany               -0.106        -0.077    
##                     p = 0.567      p = 0.598  
##                                               
## USA                   0.052          0.051    
##                     p = 0.451      p = 0.462  
##                                               
## China                 0.018                   
##                     p = 0.801                 
##                                               
## Brazil                0.063          0.053    
##                     p = 0.490      p = 0.521  
##                                               
## Argentina             0.003          0.002    
##                     p = 0.977      p = 0.979  
##                                               
## Constant              3.515          1.129    
##                     p = 0.852      p = 0.945  
##                                               
## ----------------------------------------------
## 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", report=("vc*p"))
## 
## ==============================================================================================================
##                                                       Dependent variable:                                     
##                   --------------------------------------------------------------------------------------------
##                                                           sexmarriage                                         
##                      (1)       (2)         (3)         (4)         (5)         (6)         (7)         (8)    
## --------------------------------------------------------------------------------------------------------------
## Spain             0.084***                                                                                    
##                   p = 0.005                                                                                   
##                                                                                                               
## Portugal                     0.150***                                                                         
##                             p = 0.0004                                                                        
##                                                                                                               
## France                                  0.071***                                                              
##                                        p = 0.0001                                                             
##                                                                                                               
## Germany                                             0.093***                                                  
##                                                    p = 0.00004                                                
##                                                                                                               
## USA                                                             0.040***                                      
##                                                                p = 0.0001                                     
##                                                                                                               
## China                                                                       0.060***                          
##                                                                            p = 0.0002                         
##                                                                                                               
## Brazil                                                                                  0.062***              
##                                                                                        p = 0.00004            
##                                                                                                               
## Argentina                                                                                           0.144***  
##                                                                                                    p = 0.0002 
##                                                                                                               
## Constant          -8.047*** -14.198***  -7.048***   -9.417***   -4.625***   -4.318***   -6.539***  -12.905*** 
##                   p = 0.001 p = 0.0001 p = 0.00001 p = 0.00001 p = 0.00000 p = 0.00000 p = 0.00000 p = 0.00003
##                                                                                                               
## --------------------------------------------------------------------------------------------------------------
## 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", report=("vc*p"))
## 
## ==================================================
##                         Dependent variable:       
##                   --------------------------------
##                             sexmarriage           
##                      (1)       (2)         (3)    
## --------------------------------------------------
## Spain             0.084***                0.051   
##                   p = 0.005             p = 0.107 
##                                                   
## Portugal                     0.150***   0.132***  
##                             p = 0.0004  p = 0.003 
##                                                   
## Constant          -8.047*** -14.198*** -16.637*** 
##                   p = 0.001 p = 0.0001 p = 0.00002
##                                                   
## --------------------------------------------------
## 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",report=("vc*p"))
## 
## ==============================================
##                       Dependent variable:     
##                   ----------------------------
##                           sexmarriage         
##                        (1)            (2)     
## ----------------------------------------------
## USA                  0.040***       0.049*    
##                     p = 0.0001     p = 0.089  
##                                               
## China                               -0.015    
##                                    p = 0.735  
##                                               
## Constant            -4.625***      -4.609***  
##                    p = 0.00000    p = 0.00000 
##                                               
## ----------------------------------------------
## 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",report=("vc*p"))
## 
## ===================================================
##                          Dependent variable:       
##                   ---------------------------------
##                              sexmarriage           
##                       (1)         (2)        (3)   
## ---------------------------------------------------
## Brazil             0.062***                 0.040  
##                   p = 0.00004             p = 0.138
##                                                    
## Argentina                      0.144***     0.062  
##                               p = 0.0002  p = 0.338
##                                                    
## Constant           -6.539***  -12.905***  -9.648***
##                   p = 0.00000 p = 0.00003 p = 0.007
##                                                    
## ---------------------------------------------------
## 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
stargazer(rlog9, log1, rlog5,log2, log3, type="text",report=("vc*p"))
## 
## =========================================================================
##                                     Dependent variable:                  
##                   -------------------------------------------------------
##                                         sexmarriage                      
##                      (1)        (2)         (3)         (4)        (5)   
## -------------------------------------------------------------------------
## Spain               0.040      0.051                                     
##                   p = 0.498  p = 0.107                                   
##                                                                          
## Portugal           -0.126    0.132***                                    
##                   p = 0.500  p = 0.003                                   
##                                                                          
## France              0.015                                                
##                   p = 0.773                                              
##                                                                          
## Germany            -0.106                                                
##                   p = 0.567                                              
##                                                                          
## USA                 0.052                0.040***     0.049*             
##                   p = 0.451             p = 0.0001   p = 0.089           
##                                                                          
## China               0.018                             -0.015             
##                   p = 0.801                          p = 0.735           
##                                                                          
## Brazil              0.063                                         0.040  
##                   p = 0.490                                     p = 0.138
##                                                                          
## Argentina           0.003                                         0.062  
##                   p = 0.977                                     p = 0.338
##                                                                          
## Constant            3.515   -16.637***   -4.625***   -4.609***  -9.648***
##                   p = 0.852 p = 0.00002 p = 0.00000 p = 0.00000 p = 0.007
##                                                                          
## -------------------------------------------------------------------------
## Observations         260        260         260         260        260   
## Log Likelihood    -117.612   -119.440    -119.474    -119.417   -118.658 
## Akaike Inf. Crit.  253.223    244.881     242.948     244.835    243.317 
## =========================================================================
## Note:                                         *p<0.1; **p<0.05; ***p<0.01