Question: Please use R and you submit a word document, you must copy your R Code and results (generally just copy what the output in the

Please use R and you submit a word document, you must copy your R Code and results (generally just copy what the output in the console is and it will include your code). Don't provide me R code with original data output please - it makes it too long. When you copy and paste it to word please make sure the R Code / Output is in courier font (10 pt).

1 Machine Learning Using the Mpg.csv dataset (See Data Files Link in Blackboard or in git), answer the questions below. The analysis wishes to understand how MPG is related to other core variables.

(a) provide an appropriate training set (80%) and test set (20%) for the data.

(b) Run a basic linear regression and identify the important variables against the training set.

(c) Once you have a model, provide measures of accuracy (e.g. ME, MAE, MPE, MAPE, RMSE, etc) for the training set.

(d) Run the model against the test set and provide measures of accuracy.

(e) For any final model you choose interpret all significant variables within the context of the question.

(f) [Optional] run the model with the training set then iteratively add one row to the training set, and test measures of accuracy against the test test, i.e. allow the model to change coefficients as new data comes in. Store the measures of accuracy in a data frame for each run, and interpret the results. This requires some deep coding, but for those who want to give it a try, I will help you with it.

Note. Kindly see data

datasets/mpg.csv

https://git.cs.hofstra.edu/acsazp/it270/blob/0d56862a648efb0366082455d5032627ba55a00a/datasets/mpg.csv

"","mpg","cylinders","displacement","horsepower","weight","acceleration","model_year","origin","car name","NA","NA" "1",18,8,307,130,3504,12,70,1,"""chevrolet","chevelle","malibu""" "2",15,8,350,165,3693,11.5,70,1,"""buick","skylark","320""" "3",16,8,304,150,3433,12,70,1,"""amc","rebel","sst""" "4",15,8,429,198,4341,10,70,1,"""ford","galaxie","500""" "5",14,8,440,215,4312,8.5,70,1,"""plymouth","fury","iii""" "6",15,8,390,190,3850,8.5,70,1,"""amc","ambassador","dpl""" "7",15,8,383,170,3563,10,70,1,"""dodge","challenger","se""" "8",14,8,340,160,3609,8,70,1,"""plymouth","'cuda","340""" "9",15,8,400,150,3761,9.5,70,1,"""chevrolet","monte","carlo""" "10",14,8,455,225,3086,10,70,1,"""buick","estate","wagon" "11",24,4,113,95,2372,15,70,3,"""toyota","corona","mark" "12",26,4,97,46,1835,20.5,70,2,"""volkswagen","1131","deluxe" "13",24,4,107,90,2430,14.5,70,2,"""audi","100","ls""" "14",28,4,140,90,2264,15.5,71,1,"""chevrolet","vega","2300""" "15",16,6,225,105,3439,15.5,71,1,"""plymouth","satellite","custom""" "16",17,6,250,100,3329,15.5,71,1,"""chevrolet","chevelle","malibu""" "17",19,6,250,88,3302,15.5,71,1,"""ford","torino","500""" "18",14,8,400,175,4464,11.5,71,1,"""pontiac","catalina","brougham""" "19",14,8,351,153,4154,13.5,71,1,"""ford","galaxie","500""" "20",14,8,318,150,4096,13,71,1,"""plymouth","fury","iii""" "21",12,8,383,180,4955,11.5,71,1,"""dodge","monaco","(sw)""" "22",13,8,400,170,4746,12,71,1,"""ford","country","squire" "23",13,8,400,175,5140,12,71,1,"""pontiac","safari","(sw)""" "24",18,6,258,110,2962,13.5,71,1,"""amc","hornet","sportabout" "25",22,4,140,72,2408,19,71,1,"""chevrolet","vega","(sw)""" "26",23,4,122,86,2220,14,71,1,"""mercury","capri","2000""" "27",31,4,71,65,1773,19,71,3,"""toyota","corolla","1200""" "28",27,4,97,60,1834,19,71,2,"""volkswagen","model","111""" "29",24,4,113,95,2278,15.5,72,3,"""toyota","corona","hardtop""" "30",25,4,97.5,80,2126,17,72,1,"""dodge","colt","hardtop""" "31",23,4,97,54,2254,23.5,72,2,"""volkswagen","type","3""" "32",21,4,122,86,2226,16.5,72,1,"""ford","pinto","runabout""" "33",15,8,318,150,4135,13.5,72,1,"""plymouth","fury","iii""" "34",14,8,351,153,4129,13,72,1,"""ford","galaxie","500""" "35",17,8,304,150,3672,11.5,72,1,"""amc","ambassador","sst""" "36",13,8,350,155,4502,13.5,72,1,"""buick","lesabre","custom""" "37",12,8,350,160,4456,13.5,72,1,"""oldsmobile","delta","88" "38",13,8,400,190,4422,12.5,72,1,"""chrysler","newport","royal""" "39",19,3,70,97,2330,13.5,72,3,"""mazda","rx2","coupe""" "40",15,8,304,150,3892,12.5,72,1,"""amc","matador","(sw)""" "41",13,8,307,130,4098,14,72,1,"""chevrolet","chevelle","concours" "42",13,8,302,140,4294,16,72,1,"""ford","gran","torino" "43",14,8,318,150,4077,14,72,1,"""plymouth","satellite","custom" "44",18,4,121,112,2933,14.5,72,2,"""volvo","145e","(sw)""" "45",22,4,121,76,2511,18,72,2,"""volkswagen","411","(sw)""" "46",21,4,120,87,2979,19.5,72,2,"""peugeot","504","(sw)""" "47",26,4,96,69,2189,18,72,2,"""renault","12","(sw)""" "48",22,4,122,86,2395,16,72,1,"""ford","pinto","(sw)""" "49",28,4,97,92,2288,17,72,3,"""datsun","510","(sw)""" "50",23,4,120,97,2506,14.5,72,3,"""toyouta","corona","mark" "51",28,4,98,80,2164,15,72,1,"""dodge","colt","(sw)""" "52",27,4,97,88,2100,16.5,72,3,"""toyota","corolla","1600" "53",13,8,350,175,4100,13,73,1,"""buick","century","350""" "54",14,8,302,137,4042,14.5,73,1,"""ford","gran","torino""" "55",15,8,318,150,3777,12.5,73,1,"""dodge","coronet","custom""" "56",12,8,429,198,4952,11.5,73,1,"""mercury","marquis","brougham""" "57",13,8,400,150,4464,12,73,1,"""chevrolet","caprice","classic""" "58",14,8,318,150,4237,14.5,73,1,"""plymouth","fury","gran" "59",13,8,440,215,4735,11,73,1,"""chrysler","new","yorker" "60",12,8,455,225,4951,11,73,1,"""buick","electra","225" "61",13,8,360,175,3821,11,73,1,"""amc","ambassador","brougham""" "62",16,6,250,100,3278,18,73,1,"""chevrolet","nova","custom""" "63",26,4,97,46,1950,21,73,2,"""volkswagen","super","beetle""" "64",13,8,360,170,4654,13,73,1,"""plymouth","custom","suburb""" "65",12,8,350,180,4499,12.5,73,1,"""oldsmobile","vista","cruiser""" "66",21,6,155,107,2472,14,73,1,"""mercury","capri","v6""" "67",26,4,98,90,2265,15.5,73,2,"""fiat","124","sport" "68",15,8,350,145,4082,13,73,1,"""chevrolet","monte","carlo" "69",16,8,400,230,4278,9.5,73,1,"""pontiac","grand","prix""" "70",15,8,318,150,3399,11,73,1,"""dodge","dart","custom""" "71",20,6,156,122,2807,13.5,73,3,"""toyota","mark","ii""" "72",32,4,71,65,1836,21,74,3,"""toyota","corolla","1200""" "73",16,6,250,100,3781,17,74,1,"""chevrolet","chevelle","malibu" "74",18,6,225,105,3613,16.5,74,1,"""plymouth","satellite","sebring""" "75",16,8,302,140,4141,14,74,1,"""ford","gran","torino""" "76",13,8,350,150,4699,14.5,74,1,"""buick","century","luxus" "77",14,8,318,150,4457,13.5,74,1,"""dodge","coronet","custom" "78",14,8,302,140,4638,16,74,1,"""ford","gran","torino" "79",14,8,304,150,4257,15.5,74,1,"""amc","matador","(sw)""" "80",26,4,116,75,2246,14,74,2,"""fiat","124","tc""" "81",19,6,225,95,3264,16,75,1,"""plymouth","valiant","custom""" "82",15,8,350,145,4440,14,75,1,"""chevrolet","bel","air""" "83",16,8,318,150,4498,14.5,75,1,"""plymouth","grand","fury""" "84",16,6,250,105,3897,18.5,75,1,"""chevroelt","chevelle","malibu""" "85",20,8,262,110,3221,13.5,75,1,"""chevrolet","monza","2+2""" "86",13,8,302,129,3169,12,75,1,"""ford","mustang","ii""" "87",33,4,91,53,1795,17.5,75,3,"""honda","civic","cvcc""" "88",17.5,8,305,140,4215,13,76,1,"""chevrolet","chevelle","malibu" "89",16,8,318,150,4190,13,76,1,"""dodge","coronet","brougham""" "90",14.5,8,351,152,4215,12.8,76,1,"""ford","gran","torino""" "91",20,6,225,100,3651,17.7,76,1,"""dodge","aspen","se""" "92",18,6,250,78,3574,21,76,1,"""ford","granada","ghia""" "93",18.5,6,250,110,3645,16.2,76,1,"""pontiac","ventura","sj""" "94",17.5,6,258,95,3193,17.8,76,1,"""amc","pacer","d/l""" "95",13,8,318,150,3940,13.2,76,1,"""plymouth","volare","premier" "96",19,6,156,108,2930,15.5,76,3,"""toyota","mark","ii""" "97",31.5,4,98,68,2045,18.5,77,3,"""honda","accord","cvcc""" "98",30,4,111,80,2155,14.8,77,1,"""buick","opel","isuzu" "99",36,4,79,58,1825,18.6,77,2,"""renault","5","gtl""" "100",25.5,4,122,96,2300,15.5,77,1,"""plymouth","arrow","gs""" "101",33.5,4,85,70,1945,16.8,77,3,"""datsun","f-10","hatchback""" "102",17.5,8,305,145,3880,12.5,77,1,"""chevrolet","caprice","classic""" "103",17,8,260,110,4060,19,77,1,"""oldsmobile","cutlass","supreme""" "104",15.5,8,318,145,4140,13.7,77,1,"""dodge","monaco","brougham""" "105",15,8,302,130,4295,14.9,77,1,"""mercury","cougar","brougham""" "106",19,6,225,100,3630,17.7,77,1,"""plymouth","volare","custom""" "107",16,8,400,180,4220,11.1,77,1,"""pontiac","grand","prix" "108",15.5,8,350,170,4165,11.4,77,1,"""chevrolet","monte","carlo" "109",29,4,97,78,1940,14.5,77,2,"""volkswagen","rabbit","custom""" "110",24.5,4,151,88,2740,16,77,1,"""pontiac","sunbird","coupe""" "111",26,4,97,75,2265,18.2,77,3,"""toyota","corolla","liftback""" "112",25.5,4,140,89,2755,15.8,77,1,"""ford","mustang","ii" "113",33.5,4,98,83,2075,15.9,77,1,"""dodge","colt","m/m""" "114",43.1,4,90,48,1985,21.5,78,2,"""volkswagen","rabbit","custom" "115",32.8,4,78,52,1985,19.4,78,3,"""mazda","glc","deluxe""" "116",39.4,4,85,70,2070,18.6,78,3,"""datsun","b210","gx""" "117",36.1,4,91,60,1800,16.4,78,3,"""honda","civic","cvcc""" "118",19.9,8,260,110,3365,15.5,78,1,"""oldsmobile","cutlass","salon" "119",20.2,8,302,139,3570,12.8,78,1,"""mercury","monarch","ghia""" "120",19.2,6,231,105,3535,19.2,78,1,"""pontiac","phoenix","lj""" "121",20.2,6,200,85,2965,15.8,78,1,"""ford","fairmont","(auto)""" "122",25.1,4,140,88,2720,15.4,78,1,"""ford","fairmont","(man)""" "123",20.6,6,231,105,3380,15.8,78,1,"""buick","century","special""" "124",18.1,6,258,120,3410,15.1,78,1,"""amc","concord","d/l""" "125",19.2,8,305,145,3425,13.2,78,1,"""chevrolet","monte","carlo" "126",17.7,6,231,165,3445,13.4,78,1,"""buick","regal","sport" "127",17.5,8,318,140,4080,13.7,78,1,"""dodge","magnum","xe""" "128",21.1,4,134,95,2515,14.8,78,3,"""toyota","celica","gt" "129",23.8,4,151,85,2855,17.6,78,1,"""oldsmobile","starfire","sx""" "130",29.5,4,98,68,2135,16.6,78,3,"""honda","accord","lx""" "131",21.5,6,231,115,3245,15.4,79,1,"""pontiac","lemans","v6""" "132",19.8,6,200,85,2990,18.2,79,1,"""mercury","zephyr","6""" "133",22.3,4,140,88,2890,17.3,79,1,"""ford","fairmont","4""" "134",20.2,6,232,90,3265,18.2,79,1,"""amc","concord","dl" "135",20.6,6,225,110,3360,16.6,79,1,"""dodge","aspen","6""" "136",17,8,305,130,3840,15.4,79,1,"""chevrolet","caprice","classic""" "137",17.6,8,302,129,3725,13.4,79,1,"""ford","ltd","landau""" "138",16.5,8,351,138,3955,13.2,79,1,"""mercury","grand","marquis""" "139",18.2,8,318,135,3830,15.2,79,1,"""dodge","st.","regis""" "140",16.9,8,350,155,4360,14.9,79,1,"""buick","estate","wagon" "141",15.5,8,351,142,4054,14.3,79,1,"""ford","country","squire" "142",19.2,8,267,125,3605,15,79,1,"""chevrolet","malibu","classic" "143",18.5,8,360,150,3940,13,79,1,"""chrysler","lebaron","town" "144",31.9,4,89,71,1925,14,79,2,"""vw","rabbit","custom""" "145",34.1,4,86,65,1975,15.2,79,3,"""maxda","glc","deluxe""" "146",35.7,4,98,80,1915,14.4,79,1,"""dodge","colt","hatchback" "147",27.4,4,121,80,2670,15,79,1,"""amc","spirit","dl""" "148",25.4,5,183,77,3530,20.1,79,2,"""mercedes","benz","300d""" "149",23.9,8,260,90,3420,22.2,79,1,"""oldsmobile","cutlass","salon" "150",34.5,4,105,70,2150,14.9,79,1,"""plymouth","horizon","tc3""" "151",37.3,4,91,69,2130,14.7,79,2,"""fiat","strada","custom""" "152",28.4,4,151,90,2670,16,79,1,"""buick","skylark","limited""" "153",26.8,6,173,115,2700,12.9,79,1,"""oldsmobile","omega","brougham""" "154",38.1,4,89,60,1968,18.8,80,3,"""toyota","corolla","tercel""" "155",29.8,4,134,90,2711,15.5,80,3,"""toyota","corona","liftback""" "156",37,4,119,92,2434,15,80,3,"""datsun","510","hatchback""" "157",44.3,4,90,48,2085,21.7,80,2,"""vw","rabbit","c" "158",43.4,4,90,48,2335,23.7,80,2,"""vw","dasher","(diesel)""" "159",36.4,5,121,67,2950,19.9,80,2,"""audi","5000s","(diesel)""" "160",44.6,4,91,67,1850,13.8,80,3,"""honda","civic","1500" "161",23.7,3,70,100,2420,12.5,80,3,"""mazda","rx-7","gs""" "162",35,4,122,88,2500,15.1,80,2,"""triumph","tr7","coupe""" "163",25.8,4,156,92,2620,14.4,81,1,"""dodge","aries","wagon" "164",35.1,4,81,60,1760,16.1,81,3,"""honda","civic","1300""" "165",37,4,85,65,1975,19.4,81,3,"""datsun","210","mpg""" "166",34.1,4,91,68,1985,16,81,3,"""mazda","glc","4""" "167",34.7,4,105,63,2215,14.9,81,1,"""plymouth","horizon","4""" "168",34.4,4,98,65,2045,16.2,81,1,"""ford","escort","4w""" "169",29.9,4,98,65,2380,20.7,81,1,"""ford","escort","2h""" "170",28.1,4,141,80,3230,20.4,81,2,"""peugeot","505s","turbo" "171",24.2,6,146,120,2930,13.8,81,3,"""datsun","810","maxima""" "172",26.6,8,350,105,3725,19,81,1,"""oldsmobile","cutlass","ls""" "173",20.2,6,200,88,3060,17.1,81,1,"""ford","granada","gl""" "174",17.6,6,225,85,3465,16.6,81,1,"""chrysler","lebaron","salon""" "175",27,4,112,88,2640,18.6,82,1,"""chevrolet","cavalier","wagon""" "176",34,4,112,88,2395,18,82,1,"""chevrolet","cavalier","2-door""" "177",31,4,112,85,2575,16.2,82,1,"""pontiac","j2000","se" "178",29,4,135,84,2525,16,82,1,"""dodge","aries","se""" "179",24,4,140,92,2865,16.4,82,1,"""ford","fairmont","futura""" "180",36,4,105,74,1980,15.3,82,2,"""volkswagen","rabbit","l""" "181",37,4,91,68,2025,18.2,82,3,"""mazda","glc","custom" "182",31,4,91,68,1970,17.6,82,3,"""mazda","glc","custom""" "183",38,4,105,63,2125,14.7,82,1,"""plymouth","horizon","miser""" "184",36,4,98,70,2125,17.3,82,1,"""mercury","lynx","l""" "185",36,4,120,88,2160,14.5,82,3,"""nissan","stanza","xe""" "186",32,4,91,67,1965,15.7,82,3,"""honda","civic","(auto)""" "187",38,4,91,67,1995,16.2,82,3,"""datsun","310","gx""" "188",25,6,181,110,2945,16.4,82,1,"""buick","century","limited""" "189",38,6,262,85,3015,17,82,1,"""oldsmobile","cutlass","ciera" "190",26,4,156,92,2585,14.5,82,1,"""chrysler","lebaron","medallion""" "191",22,6,232,112,2835,14.7,82,1,"""ford","granada","l""" "192",32,4,144,96,2665,13.9,82,3,"""toyota","celica","gt""" "193",36,4,135,84,2370,13,82,1,"""dodge","charger","2.2""" "194",27,4,140,86,2790,15.6,82,1,"""ford","mustang","gl"""

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!