a3 (1)

Rmd

School

University of California, Irvine *

*We aren’t endorsed by this school

Course

10A

Subject

Computer Science

Date

Dec 6, 2023

Type

Rmd

Pages

3

Uploaded by BailiffLyrebirdMaster934

Report
--- title: Assignment 3 author: Jeff Rouder output: pdf_document --- # Objective The goal for this week is that you learn basic data manipulation steps such as setting up selection filters and `tapply()` # Background We are going to continue our analysis of the teacher evaluation data. Each questionnaire consists of a bunch of questions including diagnostics such as clarity of explanations, organization of the course, and enthusiasm. We ask whether we can use these questions to understand the strength and weaknesses of courses. # Submission Details - All assignments are turned in through Canvas - Upload your pdf only (no screen shots, no text, no .Rmd) - Due Sunday night, 11:59pm - Be midnful of late policy. # Load up new data set. ```{r,message=F,warning=F} link<-"https://raw.githubusercontent.com/rouderj/uciPsych10A- F21/main/eaterSocSciM.dat" dat<-read.table(url(link),head=T) ``` Let's look at dat ```{r} dat[1:10,] ``` # Quality-Control Check 1. How many rows and how many columns are in this set? What are the column names? Let's explore how many courses and questions there are in the set. Here is the course count: ```{r} table(dat$course) ``` Notice there are 81 courses and 18 scores per course.
2. Use the `table()` function to count the number of questions. How many questions? How many scores per question? Does the number of rows, 1458, make sense? Why? # Data manipulation: The responses to each question is numbered from 1 (lowest) to 7 (highest). The score is just the mean across all students for a course. Last week, we studied the score as a function of course. We averaged across all responses and all questions. We can do the same here. We use `tapply`. ```{r} courseMean <- tapply(dat$score,dat$course,mean) print(courseMean) # a 'named' vector names(courseMean) #just the names of each course as.vector(courseMean) #without names ``` tapply() takes three arguments: i. a vector ii. a grouping vector, iii. a function The vector courseMean should be the same as last week's score. ```{r} boxplot(courseMean) ``` # Ordering Output We can get a better view of the scores by class simply by ordering them! I do this routinely. ```{r} sort(courseMean) ``` 3. What is the mean of scores for each question? Which question has the highest mean? (actual question, not the number) Which has the lowest (actual question, not the number)? The actual questions are at https://github.com/rouderj/uciPsych10A- F21/blob/main/eaterQuestions.txt # Course Profile Let's switch our focus to questions. The 18 questions may be found here: https://github.com/rouderj/uciPsych10A-F21/blob/main/eaterQuestions.txt. Perhaps these are *diagnostic,* that is, they provide information about the strengths and faults of each course. Let's define a *profile* as the collection of 18 scores for a given class. For example, here is the *profile* for the first course. Notice the use of filter:
```{r} filter1 <- dat$course==1 print(filter1[1:25]) length(filter1) profile1 <- dat[filter1,] print(profile1) ``` Here is the profile for course c1. ```{r} plot(1:18,profile1$score,type='l', xlab="Question",ylab="Score") ``` It seems that the strength of Course 1 is Q16 ("instructor's enthusiasm and interest") and weakness of Course 1 is Q1 ("instructor's ability to communicate clearly"). Let's further examine this preliminary interpretation. ## Comparisons to Distributions Let's see if we can offer some help in interpretation? How good are these scores relative to the other courses for each question? First, the distribution of each question's score using boxplot. ```{r} boxplot(dat$score~dat$question) ``` Here is pretty version of the plot with the profile for Course 1 overlaid. ```{r} boxplot(dat$score~dat$question, xlab="Question",ylab="Score", col='wheat') lines(profile1$question,profile1$score,lwd=2,col='darkred') ``` 4. The interpretation of strengths and weaknesses may have changed now that we can compare Course 1 to the distribution of scores for all courses. What now are the strength and weaknesses? Why is Q16 no longer a strength? How strong would you say these strengths and weaknesses are? Why? 5. Examine the profile for Course 2. How is this course? What are the particular strengths and weaknesses? Do the same for Course 51.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help