Correlation analysis of United States fertility rate and child mortality rate by year from 1800 to 2015

Author

Hoaxlines Lab

Published

April 25, 2023

# United States fertility rate and child mortality rate by year from 1800 to 2015
fertility <- c(7.03,7.01,6.99,6.96,6.94,6.92,6.9,6.87,6.85,6.83,6.81,6.79,6.76,6.74,6.72,6.7,6.67,6.65,6.63,6.61,6.59,6.57,6.54,6.52,6.5,6.48,6.46,6.44,6.42,6.4,6.38,6.36,6.34,6.32,6.3,6.28,6.26,6.24,6.22,6.2,6.18,6.14,6.09,6.05,6,5.96,5.91,5.87,5.82,5.78,5.73,5.69,5.64,5.6,5.55,5.51,5.46,5.42,5.37,5.33,5.28,5.26,5.23,5.2,5.18,5.15,5.12,5.1,5.07,5.04,5.02,4.99,4.96,4.94,4.91,4.88,4.86,4.83,4.8,4.77,4.75,4.7,4.66,4.61,4.57,4.52,4.48,4.43,4.39,4.35,4.3,4.26,4.21,4.17,4.12,4.08,4.03,3.99,3.94,3.9,3.85,3.85,3.84,3.83,3.79,3.75,3.71,3.67,3.63,3.58,3.59,3.57,3.56,3.45,3.57,3.52,3.47,3.33,3.31,3.07,3.26,3.33,3.11,3.1,3.12,3.01,2.9,2.82,2.66,2.53,2.53,2.4,2.32,2.01,2.07,2.04,2.01,2.04,2.09,2.05,2.11,2.23,2.47,2.57,2.44,2.38,2.83,3.16,3.01,3.02,3.02,3.2,3.3,3.37,3.49,3.54,3.65,3.74,3.69,3.69,3.67,3.63,3.48,3.35,3.22,2.93,2.71,2.56,2.47,2.46,2.46,2.27,2.01,1.87,1.83,1.77,1.74,1.78,1.75,1.8,1.82,1.81,1.81,1.78,1.79,1.84,1.84,1.87,1.92,2,2.07,2.06,2.04,2.02,2,1.98,1.98,1.97,2,2.01,2.05,2.03,2.02,2.05,2.06,2.06,2.11,2.12,2.07,2,1.93,1.9,1.9,1.98,1.97,1.97)

cmortality <- c(462.89,462.7,462.5,462.31,462.12,461.93,461.73,461.54,461.35,461.15,460.96,460.42,459.88,459.34,458.8,458.27,457.73,457.19,456.65,456.11,455.57,454.61,453.64,452.68,451.72,450.76,449.79,448.83,447.87,446.9,445.94,443.96,441.99,440.01,438.03,436.06,434.08,432.1,430.12,428.15,426.17,422.81,419.45,416.08,412.72,409.36,406,402.64,399.27,395.91,392.55,386.42,380.3,374.17,368.04,361.92,355.79,349.66,343.53,337.41,331.28,329.43,327.58,325.74,323.89,322.04,320.19,318.34,316.5,314.65,312.8,317.14,321.47,325.81,330.14,334.48,338.82,343.15,347.49,351.82,356.16,346.54,336.92,327.29,317.67,308.05,298.43,288.81,279.18,274,267.97,264,260.02,257.1,253.19,249.28,246.37,242.47,238.58,234.69,231.7,227.8,216.59,215.43,224.23,217.53,218.96,217.67,202.16,193.91,201.91,187.46,180.92,185.26,175.52,170.81,177.48,178.45,236.64,166.74,165.35,143.36,143.56,147.5,137.09,127.42,118.43,110.08,102.31,95.09,88.39,82.15,76.35,70.97,77.27,72.93,73.44,71.08,67.09,60.6,59.54,58,52.54,51.48,48.18,46.12,44.55,40.82,38.79,38.7,37.7,36.6,35.6,34.7,33.8,33,32.3,31.7,31.2,30.6,30.1,29.5,28.9,28.3,27.7,27.1,26.4,25.7,24.9,24.1,23.3,22.4,21.5,20.6,19.7,18.8,17.9,17.1,16.3,15.6,15,14.4,13.9,13.4,13,12.7,12.4,12.2,11.9,11.6,11.2,10.9,10.5,10.1,9.8,9.5,9.2,8.9,8.7,8.6,8.4,8.3,8.2,8.1,8.1,8,7.9,7.8,7.7,7.5,7.4,7.2,7.1,6.9,6.7,6.5)

# Calculate correlation
correlation <- cor(fertility, cmortality)

# Print the correlation
print(correlation)
[1] 0.9672245
# Calculate Spearman correlation
correlation_spearman <- cor(fertility, cmortality, method = "spearman")

# Calculate Kendall correlation
correlation_kendall <- cor(fertility, cmortality, method = "kendall")

# Print the correlations
print(correlation_spearman)
[1] 0.955792
print(correlation_kendall)
[1] 0.8408963
res <- cor.test(fertility, cmortality,
                    method = "pearson")
res

    Pearson's product-moment correlation

data:  fertility and cmortality
t = 55.723, df = 214, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 0.9573412 0.9748475
sample estimates:
      cor 
0.9672245 
cor(fertility, cmortality, method = c("pearson", "kendall", "spearman"))
[1] 0.9672245
cor.test(fertility, cmortality, method=c("pearson", "kendall", "spearman"))

    Pearson's product-moment correlation

data:  fertility and cmortality
t = 55.723, df = 214, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 0.9573412 0.9748475
sample estimates:
      cor 
0.9672245 

[1] 0.9672245: This is the Pearson correlation coefficient, which is a measure of the strength and direction of the linear relationship between the two variables (fertility and child mortality). The value is close to 1, indicating a strong positive linear relationship between the two variables.

t = 55.723, df = 214, p-value < 2.2e-16: This part of the output reports the test statistic (t), degrees of freedom (df), and p-value for the correlation test. The t-value is 55.723, and the degrees of freedom is 214. The p-value is less than 2.2e-16, which is a very small value, indicating that the correlation is statistically significant.

alternative hypothesis: true correlation is not equal to 0: This is the alternative hypothesis for the correlation test, stating that the true correlation is not equal to 0 (i.e., there is a relationship between the two variables).

95 percent confidence interval: 0.9573412 0.9748475: This part of the output provides the 95% confidence interval for the correlation coefficient, which means that we can be 95% confident that the true correlation coefficient lies between 0.9573412 and 0.9748475.

sample estimates: cor 0.9672245: This is a summary of the sample estimate for the correlation coefficient, which is 0.9672245, as mentioned earlier.

Conclusion

The output suggests that there is a strong positive linear relationship between fertility and child mortality, and this relationship is statistically significant.