Question
Use R programming, please with explanation The file file_claim_motorctp.csv contains information on a large number of vehicle insurance claims, by policy. In this mini assignment,
Use R programming, please with explanation
The file file_claim_motorctp.csv contains information on a large number of vehicle insurance claims, by policy. In this mini assignment, you are asked to import this file into R and perform a few tasks on the data.
1. Import the file file_claim_motorctp.csv and store it in a data frame called motor.df.
2. Display the first 10 rows of your new dataset motor.df. (Note this is good practice to get a sense of the information contained in any dataset).
3. Find the number of observations (number of rows) in your newly imported dataset, and store the result in a variable called n.
4. Use function mean() to find the mean of the variable GrossLossMotor across all claims. Store the value obtained in a new variable called mean.1.
5. Repeat step 4, but do not use function mean. Instead, do it by summing all the values of GrossLossMotor and dividing the result by n. Store the value obtained in a new variable called mean.2.
6. Use a relational operator to validate that mean.1=mean.2.
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