Question
Assignment Instructions: Read the Medical Record Dataset a. Read the dataset from this link. R: Contacts With Medical Doctor (vincentarelbundock.github.io) b. Format numbers to be
Assignment Instructions:
Read the Medical Record Dataset
a. Read the dataset from this link. R: Contacts With Medical Doctor (vincentarelbundock.github.io)
b. Format numbers to be displayed with two decimal positions.
c. View the first 5 rows in the Medical Dataset.
d. Customize the column names so that the first column's label becomes 'id'.
make Function Analyzing the Association Between Two Variables
a. Create the function medical_stats which calculates the regression line between two variables var1 and var2, and returns the slope and intercept. The function should display a message indicating whether:
b. Apply the function to the following pairs of variables to determine whether there is an association between them:
Predict the Number of Chronic Diseases
Predict the number of chronic diseases for a family with the head of the household having 15 years of education.
make a Function Plotting the Association between Two Variables and the Regression Line
The function should plot the graph between the two variables and display it using the jointplot function of the seaborn module.
Apply the function to plot the association between the following pairs of variables:
a. age and ndisease
b. educdec and ndisease
css
Copy code
i. age and ndisease ii. mdu and ndisease iii. educdec and ndisease iv. lpi and ndisease v. linc and ndisease vi. lfam and ndisease vii. idp and ndisease viii. lc and ndisease ix. fmde and ndisease
csharp
Copy code
i. There is a significant association or not (p-value <= 0.05). ii. In the case where there is a significant association, whether the association is positive (slope > 0), negative (slope < 0), or non-existent (slope = 0).
this is what is inside the link,
Contacts With Medical Doctor
Description
a cross-section from 1977-1978
number of observations : 20186
Usage
data(DoctorContacts)
Format
A time series containing :
mdu
number of outpatient visits to a medical doctor
lc
log(coinsrate+1) where coinsurance rate is 0 to 100
idp
individual deductible plan ?
lpi
log(annual participation incentive payment) or 0 if no payment
fmde
log(max(medical deductible expenditure)) if IDP=1 and MDE>1 or 0 otherwise
physlim
physical limitation ?
ndisease
number of chronic diseases
health
self-rate health (excellent,good,fair,poor)
linc
log of annual family income (in $)
lfam
log of family size
educdec
years of schooling of household head
age
exact age
sex
sex (male,female)
child
age less than 18 ?
black
is household head black ?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started