data(women) head(women, 10)
## height weight ## 1 58 115 ## 2 59 117 ## 3 60 120 ## 4 61 123 ## 5 62 126 ## 6 63 129 ## 7 64 132 ## 8 65 135 ## 9 66 139 ## 10 67 142
2026-04-11
data(women) head(women, 10)
## height weight ## 1 58 115 ## 2 59 117 ## 3 60 120 ## 4 61 123 ## 5 62 126 ## 6 63 129 ## 7 64 132 ## 8 65 135 ## 9 66 139 ## 10 67 142
The formula for a Simple Linear Regression is:
\[\hat{y} = b_0 + b_1X_1\]
Where:
\(\hat{y} = Dependent Variabl (Weight)\)
\(b_0 = y-intercept\)
\(b_1 = Slope Coefficient\)
\(X_1 = Independent Variable (Height)\)
The formula for mean is:
\[\bar{x} = \frac{\sum x_i}{n}\]
Where:
\(\bar{x}\) = The sample mean or average
\(\sum x_i\) = The sum of all values
\(n\) = The total number of observations
txhousing %>% filter(year == 2000) %>% group_by(month) %>% summarize(total_sales = sum(sales, na.rm = TRUE)) %>% ggplot(aes(x=factor(month), y = total_sales)) + geom_col() + labs(x = "Month", y = "Total Number of Sales", title = "Total Number of Home Sales in Texas for Each Month (2000)")