R-Studio Midterm 2 Flashcards

1
Q

regression

A

lm(dv ~ iv, data = dataset)

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

adding categorical variable to regression

A

lm(dv ~ iv, as.factor(variable), data = dataset)

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

adding binary variable to regression

A

lm(dv ~ iv + variable 1 + variable 2, data = dataset)

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

adding interaction to regression

A

lm(dv ~ iv, as.factor(variable), dv:as.factor(variable), data = dataset)

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

quadratic lm model

A

lm(dv ~ iv + I(iv^2), data = dataset)

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

generalized linear model

A

glm(dv ~ iv, data = dataset, family = binominal (link = “logit”))

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

adding a covariate to generalized linear model

A

glm(dv ~ iv + as.factor(variable), data - dataset, family = binominal (link = “logit”))

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

adding an interaction to generalized linear model

A

glm(dv ~ iv + as.factor(variable) + iv:as.factor(variable), data - dataset, family = binominal (link = “logit”))

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

MANOVA

A

MANOVA(cbind(dv1, dv2, data= dataset)

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

Linear Discriminant Analysis

A

lda(iv ~ dv1 + dv2 + dv3, data = dataset)

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

predicting for LDA

A

head(predict(lda)$posterior)

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

confusion matrix

A

table(predict(lda)$class, dataset$iv)

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