#start with clean workspace 
rm(list=ls())
getwd()
#> [1] "C:/Users/ninab/OneDrive/Documenten/GitHub/labjournal"

1 packages

library(data.table) 
library(tidyverse) 
require(stringi)
require(Rsiena)
require(igraph)
#load dataobjects
load("./data/descriptives/UU_dfv2.RData")

2 Model 1: ethnicity ego

divego.divnet.lm<-lm(soc_df$div.net ~ soc_df$div.ego)
summary(divego.divnet.lm)
#> 
#> Call:
#> lm(formula = soc_df$div.net ~ soc_df$div.ego)
#> 
#> Residuals:
#>     Min      1Q  Median      3Q     Max 
#> -52.759 -10.837   1.303   9.003  51.303 
#> 
#> Coefficients:
#>                Estimate Std. Error t value Pr(>|t|)    
#> (Intercept)      52.759      7.625   6.919 9.25e-08 ***
#> soc_df$div.ego  -24.062      9.133  -2.635    0.013 *  
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Residual standard error: 24.11 on 31 degrees of freedom
#> Multiple R-squared:  0.1829, Adjusted R-squared:  0.1566 
#> F-statistic: 6.941 on 1 and 31 DF,  p-value: 0.01303

3 Model 2: year first publication

pubfirst.divnet.lm<-lm(soc_df$div.net ~ soc_df$pub_first)
summary(pubfirst.divnet.lm)
#> 
#> Call:
#> lm(formula = soc_df$div.net ~ soc_df$pub_first)
#> 
#> Residuals:
#>     Min      1Q  Median      3Q     Max 
#> -41.360 -13.023  -6.090   9.686  57.389 
#> 
#> Coefficients:
#>                   Estimate Std. Error t value Pr(>|t|)
#> (Intercept)      -800.2789   681.4321  -1.174    0.249
#> soc_df$pub_first    0.4171     0.3398   1.227    0.229
#> 
#> Residual standard error: 26.05 on 31 degrees of freedom
#> Multiple R-squared:  0.04633,    Adjusted R-squared:  0.01557 
#> F-statistic: 1.506 on 1 and 31 DF,  p-value: 0.229

4 Model 3: gender

gender.divnet.lm<-lm(soc_df$div.net ~ soc_df$gender4)
summary(gender.divnet.lm)
#> 
#> Call:
#> lm(formula = soc_df$div.net ~ soc_df$gender4)
#> 
#> Residuals:
#>     Min      1Q  Median      3Q     Max 
#> -39.945 -11.375  -3.417   9.443  60.055 
#> 
#> Coefficients:
#>                Estimate Std. Error t value Pr(>|t|)    
#> (Intercept)      39.945      7.342   5.441 6.07e-06 ***
#> soc_df$gender4   -6.528      9.431  -0.692    0.494    
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Residual standard error: 26.47 on 31 degrees of freedom
#> Multiple R-squared:  0.01522,    Adjusted R-squared:  -0.01655 
#> F-statistic: 0.4791 on 1 and 31 DF,  p-value: 0.494

5 Model 4: ethnicity ego + year first publication + gender

final.divnet.lm<-lm(soc_df$div.net ~ soc_df$div.ego + soc_df$pub_first + soc_df$gender4)
summary(final.divnet.lm)
#> 
#> Call:
#> lm(formula = soc_df$div.net ~ soc_df$div.ego + soc_df$pub_first + 
#>     soc_df$gender4)
#> 
#> Residuals:
#>     Min      1Q  Median      3Q     Max 
#> -50.403 -13.919   2.265   9.642  53.316 
#> 
#> Coefficients:
#>                   Estimate Std. Error t value Pr(>|t|)  
#> (Intercept)      -232.8789   675.3779  -0.345   0.7327  
#> soc_df$div.ego    -24.0096     9.8023  -2.449   0.0206 *
#> soc_df$pub_first    0.1452     0.3354   0.433   0.6683  
#> soc_df$gender4     -9.1613     8.7939  -1.042   0.3061  
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Residual standard error: 24.36 on 29 degrees of freedom
#> Multiple R-squared:   0.22,  Adjusted R-squared:  0.1394 
#> F-statistic: 2.727 on 3 and 29 DF,  p-value: 0.06218
LS0tDQp0aXRsZTogIlVVIHJlZ3Jlc3Npb24gYW5hbHlzaXMiDQphdXRob3I6ICJieTogTmluYSBCcmFudGVuIg0KYmlibGlvZ3JhcGh5OiByZWZlcmVuY2VzLmJpYg0KLS0tDQoNCg0KDQpgYGB7ciwgaW5zdGFsbCByZW1vdGVseSwgZ2xvYmFsc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