Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

R Markdown (a) Create a vector, fulliq, in R that has the IQ values from the tab

ID: 3884123 • Letter: R

Question

R Markdown

(a) Create a vector, fulliq, in R that has the IQ values from the table in the order given. Display the vector. Use R to compute the median, mean and standard deviation of the fulliq values and report the results.

(b) Create additional vectors, id, sex and group that contain the id labels, genders and group labels in the order given in the table above. Note that sex and group contain text data and recall or review how to enter text. Display all of the vectors

idsex fulliq group 157 M 158 M 161 F 162 F 163F 201 M 202 F 203 M 204 M 206 F 107 lead = 40

Explanation / Answer

Let the table/matrix name be mat

a .

1. Create a vector fulliq and display it using the following code/command:

fulliq <- mat[,3]
fulliq

2. To compute and report mean,median and standard deveiation of fulliq values use the following code/command:

mean(fulliq)
median(fulliq)
sd(fulliq)

b.

1. Create 3 vectors namely id,sex and group and display them using the following code/commands:

id <- mat[,1]
sex <- mat[,2]
group <- mat[,4]
id
sex
group