Explore data analysis

Goal: verify the correlation between multi-Interdisciplinary profile of Brazilian graduate professors and software production in Brazil.

Database: Curriculum Lattes database.

Acknowledgements: Institute Stela and Cnpq (Lattes Platform Team).

Metrics: Created by Vivian Alves, for her PhD. Dissertation.

1. Basic statistics into Computer Science graduate programs data"

# Dimension of table - Row & Colunms
dim(Prof_Prog)
## [1] 5574   31
# Colunm names - variables
colnames(Prof_Prog) 
##  [1] "nro_id_cnpq"                "seq_pessoa_fisica"         
##  [3] "nome_sucupira"              "nome_cvlattes"             
##  [5] "nome_filtro_cvlattes"       "sgl_instituicao"           
##  [7] "nme_instituicao"            "cod_programa"              
##  [9] "nme_programa"               "nme_area_avaliacao"        
## [11] "seq_area_basica"            "area_basica"               
## [13] "grande_area_basica"         "nro_nota_doutorado"        
## [15] "nro_nota_mestrado"          "nro_nota_mestrado_prof"    
## [17] "dta_inicio"                 "dta_fim"                   
## [19] "seq_tipo_categoria_vinculo" "nivel_formacao"            
## [21] "ano_inicio_formacao"        "ano_fim_formacao"          
## [23] "formacao_concluida"         "sigla_pais_ies_formacao"   
## [25] "sigla_uf_ies_formacao"      "sigla_ies_formacao"        
## [27] "nome_ies_formacao"          "nome_curso_formacao"       
## [29] "cod_area_curso_formacao"    "grande_area_curso_formacao"
## [31] "area_curso_formacao"
#Part of data
glimpse(Prof_Prog)
## Observations: 5,574
## Variables: 31
## $ nro_id_cnpq                <chr> "8983932189780223", "89839321897802...
## $ seq_pessoa_fisica          <dbl> 2287408, 2287408, 2287408, 2219567,...
## $ nome_sucupira              <chr> "ABEL GUILHERMINO DA SILVA FILHO", ...
## $ nome_cvlattes              <chr> "Abel Guilhermino da Silva Filho", ...
## $ nome_filtro_cvlattes       <chr> "ABEL GUILHERMINO DA SILVA FILHO", ...
## $ sgl_instituicao            <chr> "UFPE", "UFPE", "UFPE", "UFRJ", "UF...
## $ nme_instituicao            <chr> "UNIVERSIDADE FEDERAL DE PERNAMBUCO...
## $ cod_programa               <chr> "25001019004P6", "25001019004P6", "...
## $ nme_programa               <chr> "CIÊNCIAS DA COMPUTAÇÃO", "CIÊNCIAS...
## $ nme_area_avaliacao         <chr> "CIÊNCIA DA COMPUTAÇÃO", "CIÊNCIA D...
## $ seq_area_basica            <dbl> 10300007, 10300007, 10300007, 10304...
## $ area_basica                <chr> "CIÊNCIA DA COMPUTAÇÃO", "CIÊNCIA D...
## $ grande_area_basica         <chr> "CIÊNCIAS EXATAS E DA TERRA", "CIÊN...
## $ nro_nota_doutorado         <dbl> 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 4, 4,...
## $ nro_nota_mestrado          <dbl> 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 4, 4,...
## $ nro_nota_mestrado_prof     <dbl> 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0,...
## $ dta_inicio                 <chr> "01/01/2013", "01/01/2013", "01/01/...
## $ dta_fim                    <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA,...
## $ seq_tipo_categoria_vinculo <dbl> 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,...
## $ nivel_formacao             <chr> "Doutorado", "Mestrado", "Graduação...
## $ ano_inicio_formacao        <dbl> 2002, 1999, 1993, 1978, 1981, 1974,...
## $ ano_fim_formacao           <dbl> 2006, 2001, 1997, 1981, 1986, 1978,...
## $ formacao_concluida         <chr> "Sim", "Sim", "Sim", "Sim", "Sim", ...
## $ sigla_pais_ies_formacao    <chr> "BRA", "BRA", "BRA", "BRA", "GBR", ...
## $ sigla_uf_ies_formacao      <chr> "PE", "PE", "PE", "RJ", NA, "RJ", "...
## $ sigla_ies_formacao         <chr> "UFPE", "UFPE", "UFPE", "PUC-Rio", ...
## $ nome_ies_formacao          <chr> "Universidade Federal de Pernambuco...
## $ nome_curso_formacao        <chr> "Ciências da Computação", "Ciências...
## $ cod_area_curso_formacao    <dbl> 10300007, 10300007, 30400007, 30400...
## $ grande_area_curso_formacao <chr> "Ciências Exatas e da Terra", "Ciên...
## $ area_curso_formacao        <chr> "Ciência da Computação", "Ciência d...
 #10 first lines
head(Prof_Prog, 10)
## # A tibble: 10 x 31
##    nro_id_cnpq seq_pessoa_fisi~ nome_sucupira nome_cvlattes
##    <chr>                  <dbl> <chr>         <chr>        
##  1 8983932189~          2287408 ABEL GUILHER~ Abel Guilher~
##  2 8983932189~          2287408 ABEL GUILHER~ Abel Guilher~
##  3 8983932189~          2287408 ABEL GUILHER~ Abel Guilher~
##  4 0907883161~          2219567 ABILIO PEREI~ Abilio Perei~
##  5 0907883161~          2219567 ABILIO PEREI~ Abilio Perei~
##  6 0907883161~          2219567 ABILIO PEREI~ Abilio Perei~
##  7 3179032920~          2335251 ADAILTON MAG~ Adailton Mag~
##  8 3179032920~          2335251 ADAILTON MAG~ Adailton Mag~
##  9 3179032920~          2335251 ADAILTON MAG~ Adailton Mag~
## 10 3179032920~          2335251 ADAILTON MAG~ Adailton Mag~
## # ... with 27 more variables: nome_filtro_cvlattes <chr>,
## #   sgl_instituicao <chr>, nme_instituicao <chr>, cod_programa <chr>,
## #   nme_programa <chr>, nme_area_avaliacao <chr>, seq_area_basica <dbl>,
## #   area_basica <chr>, grande_area_basica <chr>, nro_nota_doutorado <dbl>,
## #   nro_nota_mestrado <dbl>, nro_nota_mestrado_prof <dbl>,
## #   dta_inicio <chr>, dta_fim <chr>, seq_tipo_categoria_vinculo <dbl>,
## #   nivel_formacao <chr>, ano_inicio_formacao <dbl>,
## #   ano_fim_formacao <dbl>, formacao_concluida <chr>,
## #   sigla_pais_ies_formacao <chr>, sigla_uf_ies_formacao <chr>,
## #   sigla_ies_formacao <chr>, nome_ies_formacao <chr>,
## #   nome_curso_formacao <chr>, cod_area_curso_formacao <dbl>,
## #   grande_area_curso_formacao <chr>, area_curso_formacao <chr>
# Data structure
str(Prof_Prog) 
## Classes 'spec_tbl_df', 'tbl_df', 'tbl' and 'data.frame': 5574 obs. of  31 variables:
##  $ nro_id_cnpq               : chr  "8983932189780223" "8983932189780223" "8983932189780223" "0907883161698484" ...
##  $ seq_pessoa_fisica         : num  2287408 2287408 2287408 2219567 2219567 ...
##  $ nome_sucupira             : chr  "ABEL GUILHERMINO DA SILVA FILHO" "ABEL GUILHERMINO DA SILVA FILHO" "ABEL GUILHERMINO DA SILVA FILHO" "ABILIO PEREIRA DE LUCENA FILHO" ...
##  $ nome_cvlattes             : chr  "Abel Guilhermino da Silva Filho" "Abel Guilhermino da Silva Filho" "Abel Guilhermino da Silva Filho" "Abilio Pereira de Lucena Filho" ...
##  $ nome_filtro_cvlattes      : chr  "ABEL GUILHERMINO DA SILVA FILHO" "ABEL GUILHERMINO DA SILVA FILHO" "ABEL GUILHERMINO DA SILVA FILHO" "ABILIO PEREIRA DE LUCENA FILHO" ...
##  $ sgl_instituicao           : chr  "UFPE" "UFPE" "UFPE" "UFRJ" ...
##  $ nme_instituicao           : chr  "UNIVERSIDADE FEDERAL DE PERNAMBUCO" "UNIVERSIDADE FEDERAL DE PERNAMBUCO" "UNIVERSIDADE FEDERAL DE PERNAMBUCO" "UNIVERSIDADE FEDERAL DO RIO DE JANEIRO" ...
##  $ cod_programa              : chr  "25001019004P6" "25001019004P6" "25001019004P6" "31001017004P3" ...
##  $ nme_programa              : chr  "CIÊNCIAS DA COMPUTAÇÃO" "CIÊNCIAS DA COMPUTAÇÃO" "CIÊNCIAS DA COMPUTAÇÃO" "ENGENHARIA DE SISTEMAS E COMPUTAÇÃO" ...
##  $ nme_area_avaliacao        : chr  "CIÊNCIA DA COMPUTAÇÃO" "CIÊNCIA DA COMPUTAÇÃO" "CIÊNCIA DA COMPUTAÇÃO" "CIÊNCIA DA COMPUTAÇÃO" ...
##  $ seq_area_basica           : num  10300007 10300007 10300007 10304002 10304002 ...
##  $ area_basica               : chr  "CIÊNCIA DA COMPUTAÇÃO" "CIÊNCIA DA COMPUTAÇÃO" "CIÊNCIA DA COMPUTAÇÃO" "CIÊNCIA DA COMPUTAÇÃO" ...
##  $ grande_area_basica        : chr  "CIÊNCIAS EXATAS E DA TERRA" "CIÊNCIAS EXATAS E DA TERRA" "CIÊNCIAS EXATAS E DA TERRA" "CIÊNCIAS EXATAS E DA TERRA" ...
##  $ nro_nota_doutorado        : num  7 7 7 7 7 7 0 0 0 0 ...
##  $ nro_nota_mestrado         : num  7 7 7 7 7 7 0 0 0 0 ...
##  $ nro_nota_mestrado_prof    : num  0 0 0 0 0 0 3 3 3 3 ...
##  $ dta_inicio                : chr  "01/01/2013" "01/01/2013" "01/01/2013" "01/02/1998" ...
##  $ dta_fim                   : chr  NA NA NA NA ...
##  $ seq_tipo_categoria_vinculo: num  3 3 3 3 3 3 3 3 3 3 ...
##  $ nivel_formacao            : chr  "Doutorado" "Mestrado" "Graduação" "Mestrado" ...
##  $ ano_inicio_formacao       : num  2002 1999 1993 1978 1981 ...
##  $ ano_fim_formacao          : num  2006 2001 1997 1981 1986 ...
##  $ formacao_concluida        : chr  "Sim" "Sim" "Sim" "Sim" ...
##  $ sigla_pais_ies_formacao   : chr  "BRA" "BRA" "BRA" "BRA" ...
##  $ sigla_uf_ies_formacao     : chr  "PE" "PE" "PE" "RJ" ...
##  $ sigla_ies_formacao        : chr  "UFPE" "UFPE" "UFPE" "PUC-Rio" ...
##  $ nome_ies_formacao         : chr  "Universidade Federal de Pernambuco" "Universidade Federal de Pernambuco" "Universidade Federal de Pernambuco" "Pontifícia Universidade Católica do Rio de Janeiro" ...
##  $ nome_curso_formacao       : chr  "Ciências da Computação" "Ciências da Computação" "Engenharia Elétrica Eletrotécnica" "Engenharia Elétrica" ...
##  $ cod_area_curso_formacao   : num  10300007 10300007 30400007 30400007 10300007 ...
##  $ grande_area_curso_formacao: chr  "Ciências Exatas e da Terra" "Ciências Exatas e da Terra" "Engenharias" "Engenharias" ...
##  $ area_curso_formacao       : chr  "Ciência da Computação" "Ciência da Computação" "Engenharia Elétrica" "Engenharia Elétrica" ...
##  - attr(*, "spec")=
##   .. cols(
##   ..   nro_id_cnpq = col_character(),
##   ..   seq_pessoa_fisica = col_double(),
##   ..   nome_sucupira = col_character(),
##   ..   nome_cvlattes = col_character(),
##   ..   nome_filtro_cvlattes = col_character(),
##   ..   sgl_instituicao = col_character(),
##   ..   nme_instituicao = col_character(),
##   ..   cod_programa = col_character(),
##   ..   nme_programa = col_character(),
##   ..   nme_area_avaliacao = col_character(),
##   ..   seq_area_basica = col_double(),
##   ..   area_basica = col_character(),
##   ..   grande_area_basica = col_character(),
##   ..   nro_nota_doutorado = col_double(),
##   ..   nro_nota_mestrado = col_double(),
##   ..   nro_nota_mestrado_prof = col_double(),
##   ..   dta_inicio = col_character(),
##   ..   dta_fim = col_character(),
##   ..   seq_tipo_categoria_vinculo = col_double(),
##   ..   nivel_formacao = col_character(),
##   ..   ano_inicio_formacao = col_double(),
##   ..   ano_fim_formacao = col_double(),
##   ..   formacao_concluida = col_character(),
##   ..   sigla_pais_ies_formacao = col_character(),
##   ..   sigla_uf_ies_formacao = col_character(),
##   ..   sigla_ies_formacao = col_character(),
##   ..   nome_ies_formacao = col_character(),
##   ..   nome_curso_formacao = col_character(),
##   ..   cod_area_curso_formacao = col_double(),
##   ..   grande_area_curso_formacao = col_character(),
##   ..   area_curso_formacao = col_character()
##   .. )
# Summary of data
summary(Prof_Prog) 
##  nro_id_cnpq        seq_pessoa_fisica nome_sucupira     
##  Length:5574        Min.   :2203421   Length:5574       
##  Class :character   1st Qu.:2245056   Class :character  
##  Mode  :character   Median :2284172   Mode  :character  
##                     Mean   :2279582                     
##                     3rd Qu.:2320519                     
##                     Max.   :2340119                     
##                                                         
##  nome_cvlattes      nome_filtro_cvlattes sgl_instituicao   
##  Length:5574        Length:5574          Length:5574       
##  Class :character   Class :character     Class :character  
##  Mode  :character   Mode  :character     Mode  :character  
##                                                            
##                                                            
##                                                            
##                                                            
##  nme_instituicao    cod_programa       nme_programa      
##  Length:5574        Length:5574        Length:5574       
##  Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character  
##                                                          
##                                                          
##                                                          
##                                                          
##  nme_area_avaliacao seq_area_basica    area_basica       
##  Length:5574        Min.   :10300007   Length:5574       
##  Class :character   1st Qu.:10300007   Class :character  
##  Mode  :character   Median :10300007   Mode  :character  
##                     Mean   :10300162                     
##                     3rd Qu.:10300007                     
##                     Max.   :10304045                     
##                                                          
##  grande_area_basica nro_nota_doutorado nro_nota_mestrado
##  Length:5574        Min.   :0.000      Min.   :0.000    
##  Class :character   1st Qu.:0.000      1st Qu.:3.000    
##  Mode  :character   Median :4.000      Median :4.000    
##                     Mean   :3.373      Mean   :3.978    
##                     3rd Qu.:5.000      3rd Qu.:5.000    
##                     Max.   :7.000      Max.   :7.000    
##                                                         
##  nro_nota_mestrado_prof  dta_inicio          dta_fim         
##  Min.   :0.0000         Length:5574        Length:5574       
##  1st Qu.:0.0000         Class :character   Class :character  
##  Median :0.0000         Mode  :character   Mode  :character  
##  Mean   :0.3931                                              
##  3rd Qu.:0.0000                                              
##  Max.   :4.0000                                              
##                                                              
##  seq_tipo_categoria_vinculo nivel_formacao     ano_inicio_formacao
##  Min.   :1.000              Length:5574        Min.   :1953       
##  1st Qu.:3.000              Class :character   1st Qu.:1990       
##  Median :3.000              Mode  :character   Median :1998       
##  Mean   :2.853                                 Mean   :1996       
##  3rd Qu.:3.000                                 3rd Qu.:2003       
##  Max.   :3.000                                 Max.   :2018       
##                                                NA's   :2          
##  ano_fim_formacao formacao_concluida sigla_pais_ies_formacao
##  Min.   :1957     Length:5574        Length:5574            
##  1st Qu.:1993     Class :character   Class :character       
##  Median :2001     Mode  :character   Mode  :character       
##  Mean   :1999                                               
##  3rd Qu.:2007                                               
##  Max.   :2018                                               
##  NA's   :13                                                 
##  sigla_uf_ies_formacao sigla_ies_formacao nome_ies_formacao 
##  Length:5574           Length:5574        Length:5574       
##  Class :character      Class :character   Class :character  
##  Mode  :character      Mode  :character   Mode  :character  
##                                                             
##                                                             
##                                                             
##                                                             
##  nome_curso_formacao cod_area_curso_formacao grande_area_curso_formacao
##  Length:5574         Min.   :       3        Length:5574               
##  Class :character    1st Qu.:10300007        Class :character          
##  Mode  :character    Median :10300007        Mode  :character          
##                      Mean   :16803714                                  
##                      3rd Qu.:30100003                                  
##                      Max.   :99900009                                  
##                      NA's   :557                                       
##  area_curso_formacao
##  Length:5574        
##  Class :character   
##  Mode  :character   
##                     
##                     
##                     
## 

2. Tidy and Explore data

Creation of new tidy data frame

Were:

  1. Docentes is quantity of permanent professors,

  2. Div_Curso_Formacao is the graduate diversity of professors,

  3. Div_Area_curso_formacao is the education field diversity of professors,

  4. M1_Doc_div_Curso is the metric of multi-interdisciplinarity, with is calculate for: d = ((b + c) / 2) / a

by_program <-
  Prof_Prog %>%
  #filter only permanent professors 
  filter(seq_tipo_categoria_vinculo == 3)%>% 
  #create programa start yar variable
  mutate(ano_criacao_programa = year(dta_inicio))%>% 
  # grouping data from brazilien graduate programs
  group_by(cod_programa) %>%  
  summarize(Docentes = n_distinct(nro_id_cnpq), 
            Div_Curso_Formacao = n_distinct(nome_curso_formacao), 
            Div_Area_curso_formacao = n_distinct(area_curso_formacao), 
            M1 = (mean(Div_Curso_Formacao, Div_Curso_Formacao)) / Docentes 
            ) %>%
  arrange(desc(M1)) 

# Save tidy data frame 
write.csv(by_program, "by_programa.csv", row.names = FALSE)

# View tidy data frame
View(by_program)

2.1 Basic statistics into tidy data"

# Dimension of table - Row & Colunms
dim(by_program)
## [1] 70  5
# Colunm names - variables
colnames(by_program) 
## [1] "cod_programa"            "Docentes"               
## [3] "Div_Curso_Formacao"      "Div_Area_curso_formacao"
## [5] "M1"
#Part of data
glimpse(by_program)
## Observations: 70
## Variables: 5
## $ cod_programa            <chr> "28013018005P5", "22003010016P9", "220...
## $ Docentes                <int> 11, 18, 16, 10, 13, 23, 6, 11, 14, 14,...
## $ Div_Curso_Formacao      <int> 26, 39, 34, 21, 25, 43, 11, 20, 25, 25...
## $ Div_Area_curso_formacao <int> 12, 16, 11, 7, 5, 20, 3, 11, 5, 6, 6, ...
## $ M1                      <dbl> 2.363636, 2.166667, 2.125000, 2.100000...
 #10 first lines
head(by_program, 10)
## # A tibble: 10 x 5
##    cod_programa  Docentes Div_Curso_Formacao Div_Area_curso_formacao    M1
##    <chr>            <int>              <int>                   <int> <dbl>
##  1 28013018005P5       11                 26                      12  2.36
##  2 22003010016P9       18                 39                      16  2.17
##  3 22002014002P1       16                 34                      11  2.12
##  4 40002012033P5       10                 21                       7  2.1 
##  5 40003019004P1       13                 25                       5  1.92
##  6 53001010098P3       23                 43                      20  1.87
##  7 28001010061P1        6                 11                       3  1.83
##  8 42009014011P1       11                 20                      11  1.82
##  9 21001014031P2       14                 25                       5  1.79
## 10 40004015019P5       14                 25                       6  1.79
# Data structure
str(by_program) 
## Classes 'tbl_df', 'tbl' and 'data.frame':    70 obs. of  5 variables:
##  $ cod_programa           : chr  "28013018005P5" "22003010016P9" "22002014002P1" "40002012033P5" ...
##  $ Docentes               : int  11 18 16 10 13 23 6 11 14 14 ...
##  $ Div_Curso_Formacao     : int  26 39 34 21 25 43 11 20 25 25 ...
##  $ Div_Area_curso_formacao: int  12 16 11 7 5 20 3 11 5 6 ...
##  $ M1                     : num  2.36 2.17 2.12 2.1 1.92 ...
# Summary of data
summary(by_program) 
##  cod_programa          Docentes     Div_Curso_Formacao
##  Length:70          Min.   : 6.00   Min.   :11        
##  Class :character   1st Qu.:13.00   1st Qu.:19        
##  Mode  :character   Median :17.50   Median :25        
##                     Mean   :22.20   Mean   :28        
##                     3rd Qu.:28.75   3rd Qu.:35        
##                     Max.   :76.00   Max.   :64        
##  Div_Area_curso_formacao       M1        
##  Min.   : 3.00           Min.   :0.6538  
##  1st Qu.: 6.00           1st Qu.:1.1391  
##  Median : 8.50           Median :1.3052  
##  Mean   : 9.40           Mean   :1.3664  
##  3rd Qu.:11.75           3rd Qu.:1.5781  
##  Max.   :21.00           Max.   :2.3636

3. Data visualization experiments

#1. Graphics functions
#1.1  by Melina de Souza Leite 
panel.hist <- function(x, ...)
{
  usr <- par("usr"); on.exit(par(usr))
  par(usr = c(usr[1:2], 0, 1.5) )
  h <- hist(x, plot = FALSE)
  breaks <- h$breaks; nB <- length(breaks)
  y <- h$counts; y <- y/max(y)
  rect(breaks[-nB], 0, breaks[-1], y, col = "cyan", ...)
}

# 1.2 by Melina de Souza Leite 
panel.lm <- function (x, y, col = par("col"), bg = NA, pch = par("pch"), 
                      cex = 1, col.line="red") {
  points(x, y, pch = pch, col = col, bg = bg, cex = cex)
  ok <- is.finite(x) & is.finite(y)
  if (any(ok)) {
    abline(lm(y[ok]~x[ok]), col = col.line)
  }
}

# 1.3 help(pairs) by Melina de Souza Leite 
panel.cor <- function(x, y, digits = 2, prefix = "", cex.cor, ...)
{
  usr <- par("usr"); on.exit(par(usr))
  par(usr = c(0, 1, 0, 1))
  r <- abs(cor(x, y))
  txt <- format(c(r, 0.123456789), digits = digits)[1]
  txt <- paste0(prefix, txt)
  if(missing(cex.cor)) cex.cor <- 0.8/strwidth(txt)
  text(0.5, 0.5, txt, cex = cex.cor * r)
}


# 10 fist programs by M1
barplot(by_program$M1[1:10], las = 2, names.arg = by_program$cod_programa[1:10],
        col ="deeppink1", main ="Multi-Interdisciplinaridade dos programas",
        ylab = "Métrica 1")

pairs(by_program[, 2:5], col = by_program$M1)

pairs(by_program[, 2:5],
      diag.panel = panel.hist,
      upper.panel = panel.cor,
      lower.panel = panel.lm)

ggcorr(by_program[, 2:5], label=T)

M <- cor(by_program[, 2:5])
corrplot(M, method = "circle")

#pair with hcluster
corrplot(M, order = "hclust", addrect = 3, tl.pos="d")

corrgram(by_program[, 2:5], 
         lower.panel = panel.pts, 
         upper.panel= panel.conf,
         diag.panel = panel.density)

corrgram(by_program[, 2:5], order=TRUE, lower.panel=panel.shade,
         upper.panel=panel.pie, text.panel=panel.txt,
         main="Metrica 1")

corrgram(by_program[, 2:5], order=TRUE, lower.panel=panel.ellipse,
         upper.panel=panel.pts, text.panel=panel.txt,
         diag.panel=panel.minmax, 
         main="Metrica 1")

with(by_program[, 2:5], pcor.test(x=Docentes, y=Div_Area_curso_formacao, z=M1))
##   estimate      p.value statistic  n gp  Method
## 1 0.686787 7.258016e-11  7.734095 70  1 pearson
pcor(by_program[, 2:5])
## $estimate
##                           Docentes Div_Curso_Formacao
## Docentes                 1.0000000          0.8917875
## Div_Curso_Formacao       0.8917875          1.0000000
## Div_Area_curso_formacao -0.1244692          0.4506336
## M1                      -0.8481452          0.7102279
##                         Div_Area_curso_formacao          M1
## Docentes                            -0.12446920 -0.84814517
## Div_Curso_Formacao                   0.45063360  0.71022791
## Div_Area_curso_formacao              1.00000000 -0.02342389
## M1                                  -0.02342389  1.00000000
## 
## $p.value
##                             Docentes Div_Curso_Formacao
## Docentes                0.000000e+00       2.025680e-24
## Div_Curso_Formacao      2.025680e-24       0.000000e+00
## Div_Area_curso_formacao 3.118684e-01       1.151575e-04
## M1                      7.063651e-20       1.179517e-11
##                         Div_Area_curso_formacao           M1
## Docentes                           0.3118683504 7.063651e-20
## Div_Curso_Formacao                 0.0001151575 1.179517e-11
## Div_Area_curso_formacao            0.0000000000 8.496201e-01
## M1                                 0.8496201113 0.000000e+00
## 
## $statistic
##                           Docentes Div_Curso_Formacao
## Docentes                  0.000000          16.012478
## Div_Curso_Formacao       16.012478           0.000000
## Div_Area_curso_formacao  -1.019118           4.100961
## M1                      -13.006481           8.196236
##                         Div_Area_curso_formacao          M1
## Docentes                             -1.0191177 -13.0064814
## Div_Curso_Formacao                    4.1009608   8.1962355
## Div_Area_curso_formacao               0.0000000  -0.1903488
## M1                                   -0.1903488   0.0000000
## 
## $n
## [1] 70
## 
## $gp
## [1] 2
## 
## $method
## [1] "pearson"
ggcorr(by_program[, 2:5], geom = "circle", nbreaks = 5)