practical codes Flashcards

(15 cards)

1
Q

how do we install psych packages

A

install.packages(“psych”)
library(psych)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how do we make a histogram

A

hist($)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

how do we make a density plot

A

dens<-density(_$)
plot(dens)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is the order we should investigate skewness

A

-ss
-dens
histogram

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how do we make boxplot and 2

A

boxplot($)
boxplot($,$)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how do you make boxplot according to condition

A

boxplot($~$)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how do we change the colour of the boxplot

A

($~$, frame=FALSE)
col=c(“ “ ,” “)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

how do we name axis

A

ylab “____” , xlab “___”
main= “ “- title
namesc(“No, Yes”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

To clean our data we need to use the subset() function write this according to the practicaldata name set

A

practicaldata_filtered<- subset(practicaldata,ResponseId!= “Response ID”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

You may have noticed that the previous command assigned (‘<-‘) the subset to a new object called ‘practicaldata_filtered’. ____________ to inspect this new object and check that in this new object, the first row from before is gone!

A

View(practicaldata_filtered)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How would we delete the second row

A

practicaldata_filtered <- subset(practicaldata_filtered, ResponseId !=”{"ImportId":"_recordId"}”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

how can we change variable names

A

datasetname_filtered$variablechanged

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do we change the variable names so they arent numbers with variables

A

datasetname_filtered$variable <- as.numeric(datasetname_filtered$variable)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

sometimes we have to reverse scores so they are not netagitve , how is this done

A

example :
practicaldata_filtered$RSE_1_R <- 5-practicaldata_filtered$RSE_1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is the way to attach a data set

A

attach(function)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly