Dataset: RealEstate.csv
Rcode:RealEstate.R
Lets Begin!!
Step 1: Load required libraries and data to R studio
Step 2: Analyze
data
Correlation lies between 1 and -1(positive
correlation and negative correlation)
Step 3: Outlier
Detection
We need to check for each variable.
Step 4: Data
Partition
Splitting the data into train and test data(75:25).
We will train the train.real data
and test the model on test.real.
Step 5: Model
lm() is used for
linear regression.
step() is used for
getting better model in terms of more correlated variables.
if vif < 5 than no multicollinearity if vif > 5 than multicollinearity is present
Here P value is more than 0.05 hence we fail to reject H0, but we do not have evidence to believe full model is better.
Step 6: Plotting model and residual
Plot 1: Independent variables VS Residuals(error)
Plot 2: Check heteroscedasticity(Residual vs Price)
Plot 3: Model
For durbinWatson Test, rho !=0 means there is correlation between Residuals and Regression analysis.
Step 7: Prediction
time!!
We got the predicted values and
saved the Observed and Predicted values in a file.
Accuracy
Step 8: Visualization
Happy
Learning!!!!

Comments
Post a Comment