1/25
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
dim(dat)
A function that helps you find the number of rows and columns in a dataset.
Boolean indexing
An indexing method that uses truth values (True/False) to filter data.
Wide data
Data format where each subject has one row, and different variables are stored in separate columns.
Long data
A data format where each row represents one observation of a single variable for a given subject.
Correlation
Statistical measure ranging from -1 to 1 indicating the strength and direction of a relationship between two variables.
round(cor(Dat),2)
A command to round correlation data to two decimal places.
R = 1
Indicates a perfect positive correlation between variables.
R = 0
Indicates no correlation between variables.
R = -1
Indicates a perfect negative correlation between variables.
tapply(score,group,mean)
A function used to compute the mean of 'score' grouped by 'group'.
Truth values
Values that can be either True or False, used in Boolean indexing.
Strings
Text values contained within quotation marks, including vector of strings.
dat[1:5,]
Indexing command in R to retrieve rows 1 to 5 from dataset 'dat'.
dat[1,0]
An incorrect data indexing command as it implies grabbing all from row one with a non-existent column.
To check that if there is missing data
we check whether the number of elements of score is the number of courses times the number of questions.
function for finding if there are any missing data
ncourse * nquestion == length(dat$score) if you get TRUE, than there are no missing data points
The function to find the output mean for each question in a data set
question_mean <- tapply(dat$score,dat$question,mean)
To make a filter for only searching for select scores of a data set
filterQ1 <- dat$question=="q1"
Function To make a filter for a select question
FilterQ1<- (dat$question=="q1")
q1scores<-(dat$score[FilterQ1])
print(q1scores)
To make a histogram
hist(q1scores)
abline(v=c1_q1scores)
what is the SEQ function used for?
used to generate sequences of numbers — similar to the : operator(from, to,by)