EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
R语言代写
您的位置: 主页 > 编程案例 > R语言代写 >
R语言代写:Analysing London using Open Data 程序代写, CS作业代写, 代码代写, 代写R语言,R代写, 算法作业代
发布时间:2021-08-03 23:31:08浏览次数:
R语言代写/数据分析代写:使用R语言进行数据分析,是一个R语言代写相关的projectAnalysing London using Open Data1. Correlation AnalysisCalculate the Pearson, Spearman and Kendall correlation between the “Average GCSE score” and “Turnoutat Mayoral election 2012” per wards, and “Employment rate” and “Happiness score” per borough.# reading filesward - read.csv( ward-profiles-excel-version.csv , fileEncoding = iso-8859-1 ,header = T, sep = , , stringsAsFactors=F, check.names=T)borough - read.csv( london-borough-profiles.csv , fileEncoding = iso-8859-1 ,header = T, sep = , , stringsAsFactors=F, check.names=T)Ward datasetColumn 54: “Average.GCSE.capped.point.scores. . . 2014”Column 67: “Turnout.at.Mayoral.election. . . 2012”Borough datasetColumn 29: “Employment.rate. . . . . . 2014.”Column 75: “Happiness.score.2011.14..out.of.10.”cor(as.numeric(ward[,54]), as.numeric(ward[,67]), method = pearson , use = complete.obs )## Warning in is.data.frame(y): NAs introduced by coercion## [1] 0.5410463cor(as.numeric(ward[,54]), as.numeric(ward[,67]), method = spearman , use = complete.obs )## Warning in is.data.frame(y): NAs introduced by coercion## [1] 0.52404631cor(as.numeric(ward[,54]), as.numeric(ward[,67]), method = kendall , use = complete.obs )## Warning in is.data.frame(y): NAs introduced by coercion## [1] 0.3706765cor(as.numeric(borough[,29]), as.numeric(borough[,75]), method = pearson , use = complete.obs )## [1] 0.3498277cor(as.numeric(borough[,29]), as.numeric(borough[,75]), method = spearman , use = complete.obs )## [1] 0.4452778cor(as.numeric(borough[,29]), as.numeric(borough[,75]), method = kendall , use = complete.obs )## [1] 0.33766052. Regression AnalysisPerform regression analysis between the same variables (as used in exercise 1) per ward and per borough.fit_ward - lm(as.numeric(ward[,54]) ~ as.numeric(ward[,67]))## Warning: NAs introduced by coercionfit_borough - lm(as.numeric(borough[,29]) ~ as.numeric(borough[,75]))3. PlottingPlot the results of the regression analysis using the ggplot2 command discuss during the lecture.library( ggplot2 )## Warning: package ggplot2 was built under R version 3.2.4ggplot(ward, aes(x = as.numeric(ward$Average.GCSE.capped.point.scores 2014),y = as.numeric(ward$Turnout.at.Mayoral.election 2012))) +geom_point(shape=1) + geom_smooth(method=lm) + xlab( Average GCSE score ) +ylab( Turnout at Mayoral election 2012 )## Warning: NAs introduced by coercion## Warning: NAs introduced by coercion## Warning: NAs introduced by coercion2## Warning: Removed 1 rows containing non-finite values (stat_smooth).## Warning: Removed 1 rows containing missing values (geom_point).20304050275 300 325 350 375 400Average GCSE scoreTurnout at Mayoral election 2012ggplot(borough, aes(x = as.numeric(borough$Employment.rate 2014.),y = as.numeric(borough$Happiness.score.2011.14..out.of.10.))) +geom_point(shape=1) + geom_smooth(method=lm) +xlab( Employment rate ) + ylab( Happiness score )## Warning: Removed 1 rows containing non-finite values (stat_smooth).## Warning: Removed 1 rows containing missing values (geom_point).36.06.57.07.560 65 70 75 80Employment rateHappiness score4. Discussion of the ResultsStarting from the results briefly discuss your findings. In particular think about the problem of having onlycorrelation and not causation in the results you are observing.4