1. Engineering
  2. Computer Science
  3. use the r data from httpwwwbcfuscedu garethislcollegecsv this exercise...

Question: use the r data from httpwwwbcfuscedu garethislcollegecsv this exercise...

Question details

use the R , data from http://www-bcf.usc.edu/ ~gareth/ISL/College.csv

This exercise relates to the College data set, which can be found in the file at http://www-bcf.usc.edu/ ~gareth/ISL/College.csv It contains a collection of variables for a number of universities and colleges in the US. The variables are described in question 8, chapter 2, of An Introduction to Statistical Learning. 1. Use the read.csv() function to read the data into R. Call the data frame college. Use the dim() function to find the dimensions of the data set. college=read.csv( ...

attach(college)

2. Look at the data using the fix() or edit() function. You should notice that the first column is just the name of each university. We don’t really want R to treat this as data. However, it may be handy have these names for later. Try the following commands, which will copy the college names into row labels which are not part of the data set, but rather as labels, and then delete the associated column.

rownames(college)= specify the first column of college

college= drop the first column

college[1:2,]

You should see that the first data column is Private. Note that another column of labels now appears before the Private column. This is not a data column but contains the labels that R is giving to each row. If you look at the data with fix() or edit(), youu will see that these labels are called “row.names”."

3. Use the summary() function to produce a numerical summary of the variables in the data set. call summary() here

7. A student wishes to find colleges for which ((the student faculty ratio S.F.Ratio is less than 14) OR (the proportion of teachers with PhDs , PhD, is greater than 85)) AND (the graduation rate, Grad-Rate, is greater than 70%). By using a suitable combination of AND (&), OR (), < and > operators, create a new data frame college2 which contains all such colleges. How many colleges in the data set satisfy the specified conditions? college2- appropriate command subset *college* How many colleges meet the specified conditions?

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution