TransWikia.com

Why is this correlation (seemingly?) wrong?

Mathematica Asked by Veritas Lux on September 17, 2020

 popDensity[k_] := 
     QuantityMagnitude[AdministrativeDivisionData[k, "PopulationDensity"]]
       
   
ResourceUpdate[
      "Epidemic Data for Novel Coronavirus COVID-19"] // Quiet
    data = ResourceData["Epidemic Data for Novel Coronavirus COVID-19", 
       "USStates"];
    
    usaStateCases[s_] := 
     Select[data, MatchQ[Interpreter["USState"][s], First[#]] &][
        All, #ConfirmedCases["LastValue"] &] // Normal // First
    
    usaStateDeaths[s_] := 
     Select[data, MatchQ[Interpreter["USState"][s], First[#]] &][
        All, #Deaths["LastValue"] &] // Normal // First
    
    usaStateCases["California"] 
    
    usaStateDeaths["California"] 
    
 
    
        
    Table[{states1[[k]], popDensity[states1[[k]]], 
       usaStateDeaths[states1[[k]]]}, {k, Length@states1}] // MatrixForm
    
    Correlation[
     Table[popDensity[states1[[k]]], {k, 1, Length@states1}], 
     Table[usaStateDeaths[states1[[k]]], {k, 1, Length@states1}]]
    Correlation[Table[popDensity[states1[[k]]], {k, 1, Length@states1}], 
     Table[usaStateCases[states1[[k]]], {k, 1, Length@states1}]]
       
  Deaths = 
      Table[{k, popDensity[states1[[k]]], 
        usaStateDeaths[states1[[k]]]}, {k, Length@states1}];
 
    Cases1 = Table[{k, popDensity[states1[[k]]], 
        usaStateCases[states1[[k]]]}, {k, Length@states1}];

I am in particular interested in the seemingly wrong estimate:

Correlation[Table[popDensity[states1[[k]]], {k, 1, Length@states1}],
Table[usaStateCases[states1[[k]]], {k, 1, Length@states1}]]

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP