This study examines the growth of the United States population from 1790 to 1850, focusing on data spanning six decades. The data points represent population figures in millions at 10-year intervals, with the year 1790 normalized to 0 to avoid the computational complexities of large exponents when fitting models. Specifically, the dataset includes population figures for the years 1790 (3.929 million), 1800 (5.308 million), 1810 (7.240 million), 1820 (9.638 million), 1830 (12.866 million), 1840 (17.069 million), and 1850 (23.192 million). A nonlinear regression approach was employed to fit the data to an exponential curve, demonstrating a clear upward trajectory in population growth.
year <- c(0,10,20,30,40,50,60)
pop <- c(3.929, 5.308, 7.240, 9.638, 12.866, 17.069, 23.192)
#PLotting the given data
plot(year, pop, main="US Population Growth (1790-1850)",
xlab="Years since 1790", ylab="Population (in millions)", pch=19)
# Load the nls2 library
library(nls2)
## Loading required package: proto
# Define the exponential model
fitline <- nls2(pop ~ pop0 * exp(k * year),
start = list(pop0 = 3.9, k = 0.05),
)
# Print the model summary to see estimated parameters
summary(fitline)
##
## Formula: pop ~ pop0 * exp(k * year)
##
## Parameters:
## Estimate Std. Error t value Pr(>|t|)
## pop0 3.9744064 0.0407277 97.58 2.14e-09 ***
## k 0.0293421 0.0002023 145.02 2.96e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.09817 on 5 degrees of freedom
##
## Number of iterations to convergence: 5
## Achieved convergence tolerance: 5.082e-08
#Adding the fitted exponential curve
lines (year,predict (fitline), col = "blue")