Saltar al contenido principal
LibreTexts Español

25.3: Correlaciones robustas (24.3.2)

  • Page ID
    150793
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    En el capítulo anterior también vimos que los datos de delitos motivados por el odio contenían un valor atípico sustancial, que parecía impulsar la correlación significativa. Para calcular la correlación de Spearman, primero necesitamos convertir los datos en sus filas, lo que podemos hacer usando la función order ():

    hateCrimes <- hateCrimes %>%
      mutate(hatecrimes_rank = order(avg_hatecrimes_per_100k_fbi),
             gini_rank = order(gini_index))

    Luego podemos calcular la correlación de Spearman aplicando la correlación de Pearson a las variables de rango”

    cor(hateCrimes$hatecrimes_rank,
      hateCrimes$gini_rank)
    ## [1] 0.057

    Vemos que esto es mucho menor que el valor obtenido usando la correlación de Pearson en los datos originales. Podemos evaluar su signficancia estadística mediante aleatorización:

    ## [1] 0.0014

    Aquí vemos que el valor p es sustancialmente mayor y está lejos de ser significativo.


    This page titled 25.3: Correlaciones robustas (24.3.2) is shared under a not declared license and was authored, remixed, and/or curated by Russell A. Poldrack via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.