Basic R Flashcards

1
Q

Get subset of data

A

subset(mdata = cdc, gender == “m” & age > 40)

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

Compute the relative frequency distribution for gender in dataset

A

table(cdc$gender) / 20000(totalnumberofdata) = males 52,1%

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

compute interquartile range

A

Subtract Q1 from Q3 to find the interquartile range.

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

help.search()

A

Help search

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

get a summary and use descriptive stastistics in dataset

A

summary(dataset)

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

main =

A

edit the header text of graph

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

col =

A

color your graph

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

all_equal()

A

all_equal() allows you to compare data frames, optionally ignoring row and column names.

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

Prop =

A

Compute proportions, percents, or counts for a single level

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

Ctable ()

A

Cross-tabulation for a pair of categorical variables (or factors) with either row, column, or total proportions, as well as marginal sums

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

range()

A

R has a function range which applied to a vector v returns a two-component vector comprising the minimal and maximal component of v.

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

var

A

Variance is the spread a variable around the means.

R has a function var for computing the variance.

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

pnorm()

A

Calculating percentiles - using computation
> pnorm(1800, mean = 1500, sd = 300)
[1] 0.8413447

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

Define a function

A

Create a function to print squares of numbers in sequence.

new.function

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

Simulations in R

A

Use the sample() function to determine the probability of rolling a 7 using three fair six-sided dies.

trials

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