1. Write R code to draw a random sample of size 50 [tem Normal (u-40, 0-15)
distribution. Represent the data using Box-plot and compte the mean and variance of the
selected sample.
2. ‘The following data gives the wage distribution of the employees in a factory, Write R
code to read the data, calculate the mean and median wage of the employees
Wages(Rs.) No, of employees
0-1000 4
1000-2000 16
2000-31KK) 60
3000-4000 100,
4000-50000 40
5000-18) 6
6000-7000 4
3. The data of sales(X) and expenses(¥) in lakhs of rupees of 10 firms is given below.
‘Write R code te read the data and perform the following:
Sales (X} 46 33 41 38 36 45 34 37 50 40
Expenses(Y): 12 13 24 16 18 14 21 17 19 19
G) Fita linear regression line y = fig + fy for the given data (x, y)
(i) Compute and plot the two lines of regression that is line of regression of ¥
‘on X and line of regression of X on ¥ on the same plot.
Gi) Display the value of x and estimated value of y in a table using data frame.
4. Consider the following frequency distribution x;|f;. Write R code to read the data and
draw less than and more than ogives on the same plot. Hence locate median on the graph.
Wages(Rs.) No. of employees
0-1000, 4
1000-2000, 16
2000-3000 60
3000-40) 100
4000-5000 40
5000-6000 6
6000-70KX) 4
3. Write R code to read the data and compute the multiple correlation coefficient R’, «, and
partial correlation coefficient t,y.xfor the following data,
Marks in Maths(X) 35 37 38 42 44 46 $1 Sd 55 56
Marks in Stats(Y) 40 32 30 42 41 31 SO 52 46 55
MarksinComp(Z} 35 90 7) 40 95 40 66 AO BO SO
6 Assample of 15 patients suffering from asthma participated in an experiment to study the
effect of new treatment on pulmonary function. The recorded measure of forced
expiratory volume (FEV) in one secnnd, before and after the application of treatment
results were as follows:
Subjects [FEV (before) | FEV (alter) | Subjects | FEV (before) | FEW (after)
T 1.69 166 g [2.58 aa
2 0.77 0.22 10 184 417
3 La 3.07 ul 199 242
4 1.66) (335 12 191 [294
5 3.00 301 13 175 3.04
6 O.8S 274 14 2.46 462
7 I 3.61 15 2.35 442
8 282 5.4
Write R-code to read the data and to test whether the treatment is efficient in increasing the
FEV at 5% level of significance.