This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
library(readxl)
## Warning: package 'readxl' was built under R version 4.4.3
AgeHeight <- read_excel("C:/Users/khalil2823/Downloads/AgeHeight.xlsx")
lmHeight=lm(height~age,data = AgeHeight)
summary(lmHeight)
##
## Call:
## lm(formula = height ~ age, data = AgeHeight)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.27238 -0.24248 -0.02762 0.16014 0.47238
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 64.9283 0.5084 127.71 < 2e-16 ***
## age 0.6350 0.0214 29.66 4.43e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.256 on 10 degrees of freedom
## Multiple R-squared: 0.9888, Adjusted R-squared: 0.9876
## F-statistic: 880 on 1 and 10 DF, p-value: 4.428e-11
lm(formula = height~age,data=AgeHeight)
##
## Call:
## lm(formula = height ~ age, data = AgeHeight)
##
## Coefficients:
## (Intercept) age
## 64.928 0.635
lmHeight2=lm(height~age+no_siblings,data=AgeHeight)
summary(lmHeight2)
##
## Call:
## lm(formula = height ~ age + no_siblings, data = AgeHeight)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.26297 -0.22462 -0.02021 0.16102 0.49752
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 64.90554 0.53526 121.260 8.96e-16 ***
## age 0.63751 0.02340 27.249 5.85e-10 ***
## no_siblings -0.01772 0.04735 -0.374 0.717
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2677 on 9 degrees of freedom
## Multiple R-squared: 0.9889, Adjusted R-squared: 0.9865
## F-statistic: 402.2 on 2 and 9 DF, p-value: 1.576e-09
You can also embed plots, for example:
Note that the echo = FALSE
parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.