Create entry on using IQR to find possible outliers in R
Create entry on using IQR to find possible outliers in R
the tutor said on his email ((Here you may use your simulated data, and the dataset mtcars in R.
Choose 1 variable for weeks 6 and 7: start with mpg for example.
Multiple variable case;))
——————————
https://cran.r-project.org/
mtcars is already in R and can be analysed to get stand residuals to compare to -2 or 2
|
> head(mtcars) mpg cyl disp hp drat wt qsec vs am gear carb Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1 Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2 Valiant 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1 > attach(mtcars) The following objects are masked from mtcars (pos = 3): am, carb, cyl, disp, drat, gear, hp, mpg, qsec, vs, wt > model <- lm(mpg ~ disp + hp + wt + qsec, data = mtcars) > rstandard(model) Mazda RX4 Mazda RX4 Wag Datsun 710 Hornet 4 Drive Hornet Sportabout -0.65456638 -0.29166549 -0.99109408 -0.13160093 0.11349120 Valiant Duster 360 Merc 240D Merc 230 Merc 280 -1.17577132 -0.65302963 0.67692139 -0.55672545 -0.15727964 Merc 280C Merc 450SE Merc 450SL Merc 450SLC Cadillac Fleetwood -0.85551938 0.39697897 0.08190899 -0.73669070 0.02236813 Lincoln Continental Chrysler Imperial Fiat 128 Honda Civic Toyota Corolla 0.49793369 2 Toyota Corona Dodge Challenger AMC Javelin Camaro Z28 Pontiac Firebird -1.57150088 -1.14579414 -1.47989966 -0.43415180 1.06927128 Fiat X1-9 Porsche 914-2 Lotus Europa Ford Pantera L Ferrari Dino -0.14990597 0.34115026 1.12804819 -0.35739634 -0.17986946 Maserati Bora Volvo 142E 0.90881167 -0.60647195 |
|
|
# 3 outliers in red |
|
|
> plot(rstandard(model))
—————————–
I attached my previos proposal
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


