9.1
For this assignment, we are expected to use the data set from the Introductory Statistics with R package titled "cystfibr", which contains patient information about people who have cystic fibrosis (ages 7-23) and their lung capacity. The goalof this assignment is to understand the relationship between the variables (age, weight, sex, height, bmp, fev1, rv, frc, tlc, and pemax).
The first thing I wanted to do was explore the data. To do this, I used the "str" and "summary" functions in R to better understand what the data looked like and how to approach it. The resulting products are as shown:
From this we can see basic trends and qualities of the data.
The first test is to determine the coefficients of the data. Using the relationship between pemax, age, and height, the coefficients are 2.7178(age) and 0.3397(height); the intercept for these variable are at 17.8600.
The primary test I am interested in running is the relationship between the pemax, height and the age in the data set. As shown, the Sum of the Squares are listed as 231.1695, with the residuals being 84.19767. The degrees of freedom are 1.
9.2
Same as the first, I chose to use the str and summary functions to better understand the data and its structure. The ISwR::Secher data set is describing ultrasonographic measurements of babies prior to and following their births. This has 107 rows and 4 columns of data included and the summary/structure looks as such:
From here I am a bit confused, as the the model is not something I am familiar with in R. When inputting the model into R as a vector using the same variables, the next step becomes unclear. The regression lines looks something like this, however the result of using the provided formula simply initializes it as a vector. Additionally, it throws an error, however this issue is likely from improper syntax. Without using logarithmic attributes, this is the resulting output:
It's apparent that this is an improper correlation, as the negative intercept is an impossibility. More practice and information required to assess the linear regression in statistical and graphical cirumstances.
No comments:
Post a Comment