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:
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