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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!