In this technical assignment, you will have the opportunity to apply the statistical knowledge that you’ve learned so far. The assignment will require you to use R Studio and import data. We recognize that doing both of these things may be new to you, so please make sure to ask your Lab TA, lecture TA, or Dr. Woodward any questions that may come up. Though the assignment is not due until Sunday, it is strongly recommended that you start the assignment before then.
You are allowed to work in groups of up to 3 students. However, you need to write the names of the people that you’ve worked with and you must hand in your own copy of the work.
Finally, you are expected to use the code that we teach you. If you use code from the internet or another source, you must cite the source appropriately and explain what the code is doing. Failure to do so will result in 0 points awarded and may be considered academic dishonesty.
I worked by myself
For this assignment, we’ll be using the world happiness report data 2022. It is provided by Ajaypal Singh on Kaggle.com, a website with different types of data.
worldHappiness <- read.csv("C:\\Users\\Reed Schneider\\Downloads\\PSY3801-WorldHappinessReport2022Fall-1.csv")
you can view the dataset by setting a variable to the dataset, in my case I named it worldHappiness, then clicking on that variable in the global environment
worldHappiness$country
## [1] "Finland" "Denmark"
## [3] "Iceland" "Switzerland"
## [5] "Netherlands" "Luxembourg*"
## [7] "Sweden" "Norway"
## [9] "Israel" "New Zealand"
## [11] "Austria" "Australia"
## [13] "Ireland" "Germany"
## [15] "Canada" "United States"
## [17] "United Kingdom" "Czechia"
## [19] "Belgium" "France"
## [21] "Bahrain" "Slovenia"
## [23] "Costa Rica" "United Arab Emirates"
## [25] "Saudi Arabia" "Taiwan Province of China"
## [27] "Singapore" "Romania"
## [29] "Spain" "Uruguay"
## [31] "Italy" "Kosovo"
## [33] "Malta" "Lithuania"
## [35] "Slovakia" "Estonia"
## [37] "Panama" "Brazil"
## [39] "Guatemala*" "Kazakhstan"
## [41] "Cyprus" "Latvia"
## [43] "Serbia" "Chile"
## [45] "Nicaragua" "Mexico"
## [47] "Croatia" "Poland"
## [49] "El Salvador" "Kuwait*"
## [51] "Hungary" "Mauritius"
## [53] "Uzbekistan" "Japan"
## [55] "Honduras" "Portugal"
## [57] "Argentina" "Greece"
## [59] "South Korea" "Philippines"
## [61] "Thailand" "Moldova"
## [63] "Jamaica" "Kyrgyzstan"
## [65] "Belarus*" "Colombia"
## [67] "Bosnia and Herzegovina" "Mongolia"
## [69] "Dominican Republic" "Malaysia"
## [71] "Bolivia" "China"
## [73] "Paraguay" "Peru"
## [75] "Montenegro" "Ecuador"
## [77] "Vietnam" "Turkmenistan*"
## [79] "North Cyprus*" "Russia"
## [81] "Hong Kong S.A.R. of China" "Armenia"
## [83] "Tajikistan" "Nepal"
## [85] "Bulgaria" "Libya*"
## [87] "Indonesia" "Ivory Coast"
## [89] "North Macedonia" "Albania"
## [91] "South Africa" "Azerbaijan*"
## [93] "Gambia*" "Bangladesh"
## [95] "Laos" "Algeria"
## [97] "Liberia*" "Ukraine"
## [99] "Congo" "Morocco"
## [101] "Mozambique" "Cameroon"
## [103] "Senegal" "Niger*"
## [105] "Georgia" "Gabon"
## [107] "Iraq" "Venezuela"
## [109] "Guinea" "Iran"
## [111] "Ghana" "Turkey"
## [113] "Burkina Faso" "Cambodia"
## [115] "Benin" "Comoros*"
## [117] "Uganda" "Nigeria"
## [119] "Kenya" "Tunisia"
## [121] "Pakistan" "Palestinian Territories*"
## [123] "Mali" "Namibia"
## [125] "Eswatini, Kingdom of*" "Myanmar"
## [127] "Sri Lanka" "Madagascar*"
## [129] "Egypt" "Chad*"
## [131] "Ethiopia" "Yemen*"
## [133] "Mauritania*" "Jordan"
## [135] "Togo" "India"
## [137] "Zambia" "Malawi"
## [139] "Tanzania" "Sierra Leone"
## [141] "Lesotho*" "Botswana*"
## [143] "Rwanda*" "Zimbabwe"
## [145] "Lebanon" "Afghanistan"
This is nominal data because there are distinct categories which is each country, but there is no order or rank to how they are split up.
worldHappiness$rank
## [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
## [19] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
## [37] 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
## [55] 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
## [73] 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
## [91] 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
## [109] 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
## [127] 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
## [145] 145 146
This data is interval data because it is a quantitative measurement that does not have a meaningful zero. The distance from rank 10 to 10 is the same as the distance from rank 20 t0 30.
worldHappiness$happiness
## [1] 7.821 7.636 7.557 7.512 7.415 7.404 7.384 7.365 7.364 7.200 7.163 7.162
## [13] 7.041 7.034 7.025 6.977 6.943 6.920 6.805 6.687 6.647 6.630 6.582 6.576
## [25] 6.523 6.512 6.480 6.477 6.476 6.474 6.467 6.455 6.447 6.446 6.391 6.341
## [37] 6.309 6.293 6.262 6.234 6.221 6.180 6.178 6.172 6.165 6.128 6.125 6.123
## [49] 6.120 6.106 6.086 6.071 6.063 6.039 6.022 6.016 5.967 5.948 5.935 5.904
## [61] 5.891 5.857 5.850 5.828 5.821 5.781 5.768 5.761 5.737 5.711 5.600 5.585
## [73] 5.578 5.559 5.547 5.533 5.485 5.474 5.467 5.459 5.425 5.399 5.377 5.377
## [85] 5.371 5.330 5.240 5.235 5.199 5.199 5.194 5.173 5.164 5.155 5.140 5.122
## [97] 5.122 5.084 5.075 5.060 5.048 5.048 5.046 5.003 4.973 4.958 4.941 4.925
## [109] 4.891 4.888 4.872 4.744 4.670 4.640 4.623 4.609 4.603 4.552 4.543 4.516
## [121] 4.516 4.483 4.479 4.459 4.396 4.394 4.362 4.339 4.288 4.251 4.241 4.197
## [133] 4.153 4.152 4.112 3.777 3.760 3.750 3.702 3.574 3.512 3.471 3.268 2.995
## [145] 2.955 2.404
I think the happiness variable is the happiness of each of the countries somehow quantified by some scale.
This is interval data because because there is no meaningful 0 in this case as a happiness of 0 does not really make logical sense