Question: Task 1 : Data cleansing ( 5 0 pt ) - Week 3 Assuming we want to run analysis using variables: Survived, Pclass, Sex, Age,
Task : Data cleansing pt Week
Assuming we want to run analysis using variables: Survived, Pclass, Sex, Age, Fare, Embarked, and want to prepare a dataset for the analysis. Please do the items below:
pt Create a subset of data which only contains selected variables. This should be a new Python variable only containing selected columns.
pt For each variable, please check whether it has any missing values. If yes, how many missing values are there.
pt If you see missing values on variables Survived, Pclass, Sex, Embarked, please removing the missing records.
pt For missing values on variables Age, Fare, please replace the missing value using average age and average fare.
pt If you identify any categorical variables please use onehot encoding to convert the variables.
pt At the end, please print the final dataset, which only contains selected variable and is well cleaned. Please indicate the number of observations in the dataset.
Task : Data Summary pt Week
Data Summary using the cleaned dataset from task
pt Print the descriptive statistics table using all numerical variables.
pt Print the correlation matrix using numerical variables.
Task : Regression Analysis pt Week
Please use the dataset you cleaned in task
pt Please build a linear regression model and run the analysis using Fare as dependent varaible, and others are independent variables. In the result, you should see:
The coefficient for each independent variable and the significant level
The Rsquared for the model.
Number of observations you used to run the analysis.
pt Based on your result, which factors significantly affect ticket fare and is there a negative or positive relationship? You can add a text block writing your answer
Hint:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
