Biology Reference
In-Depth Information
(a) Print the column names.
(b) Print the range and the quartiles of each variable.
(c) Print all the observations for which
A
falls in the interval
[
3
,
4
]
and
B
in
.
(d) Sample 50 rows without replacement.
(e) Draw a bootstrap sample (e.g., sample 5
(
−
∞
,−
5
]
∪
[
10
,
∞
)
,
000 observations with replacement)
and compute the mean of each variable.
(f) Standardize each variable.
1.6.
Generate a data frame with 100 observations for the following variables:
(a) A categorical variable with two levels,
low
and
high
. The first 50 observations
should be set to
low
, the others to
high
.
(b) A categorical variable with two levels,
good
and
bad
, nested within the first
variable, i.e., the first 25 observations should be set to
good
, the second 25 to
bad
, and so on.
(c) A continuous, numerical variable following a Gaussian distribution with mean
2 and variance 4 when the first variable is equal to
low
and with mean 4 and
variance 1 if the first variable is equal to
high
.
In addition, compute the standard deviation of the last variable for each configura-
tion of the first two variables.
Search WWH ::
Custom Search