# Help With data Assignment,R Programming AssignmentDebug ,R Course AssignmentGhostwriter ,Help With program Course AssignmentGhostwriter Python Programming|Help With SPSS

Test whether the function works for x = numeric(0) and for any other numeric
vector x.
3. The Body Mass Index (BMI) is used to determine a person’s corpulence. It is calculated
using the formula:
BMI = Weight (kg)
Height2
(m)
(a) [4 marks] Write an R function that calculates your BMI and round it to 3 decimal
places.
(b) [6 marks] Consider the following BMI and weight categories:

Underweight if BMI < 18.5
Normal weight if BMI ∈ [18.5, 25)
Overweight if BMI ∈ [25, 33)
Obesity if BMI ≥ 33
Write an R function which takes the result of (3a) as a single argument BMI, a
and returns the corresponding category. For example:
> weight.category(21.133)
This corresponds to category: normal weight
4. Consider an asymmetric random walk when the probability of going one step up is 0.55
and the probability of going one step down is 0.45. Let Xn denotes the n-th step in this
random walk. Then, X1, X2, · · · are independent and identically random variables with
Xn =
(
+1 w.p. 0.55
−1 w.p. 0.45
Assume that {Dn}n≥0 is a sequence showing the distance from the origin (starting
point). So,
D0 = 0
Dn = Dn−1 + Xn for n = 1, 2, · · ·
(a) [6 marks] Write an R function which takes the number of steps as its single argument
and returns a vector of distances (for instance shows a sequence of realization
of distances D0, D1, · · · , D10 for the argument n = 10).