Professional Documents
Culture Documents
UNIVERSITY OF ZIMBABWE
BSc Honours in Actuarial Science Level 2 HASC216
February 2020
Time : 2 hours
A1. (a) Explain the difference between input and output when typing a document in
LATEX and in Microsoft Word. [4]
(b) Differentiate between an environment and a command in LATEX. [4]
page 1 of 4
HASC216
A4. (a) Describe the five STATA windows you get when you start up STATA. [5]
(b) Which are the two right-to-left assignment operators which can be used in
R. [2]
(c) The STATA commands follow a standard syntax structure. Give and explain
any FOUR syntax elements. [8]
The second row of the table as variable names. Write one STATA do-file with all the
commands to perform the following tasks:
(a) Declare your delimiter and create a log named hsts204exam, which can be
opened in any plain text editor, such as Notepad. [4]
(b) Capture the data using the commands methods. [10]
(c) Label all variables. [2]
(d) Label values for Sex of student. [2]
(e) Compute the age of the students, name the variable age and label it accord-
ingly. [2]
(f) Compute the coursework for each student which is given by the average of the
4 pieces of work, name it cw. [2]
(g) Recode the course into the following labelled categories : <50 Fail , 50-59
Pass, 60-64 Credit, 65-74 Merit, 75+ Distinction, name the variable
CWcat and label it accordingly [3]
(h) Save your data naming the file using your UZ registration number. [1]
(i) Produce frequency tables for variable sex. [1]
(j) Produce descriptive statistics for cw . [2]
(k) Close your log file. [1]
page 2 of 4
HASC216
B7. (a) A script file with the contents below was created and saved with the name
trialdata.
# trialdata
k=c(0,1,2,3,4)
x =c(109,65, 22, 3, 1)
p =x / sum(x)
print(p)
r =sum(k *p)
v =sum(x *(k - r)ˆ2) / 199
print(r)
print(v)
f =dpois(k, r)
print(cbind(k, p, f))
(i) Give the command you would type to run the script file above if it was
saved in your working directory. [2]
(ii) EXPLAIN the effects of each of the command lines of the script file above. [8]
(b) On the next page (page 4) of this question paper is an article. Write down what
you would type (text and commands) in LATEX to produce this document
(the whole page). [20]
END OF EXAMINATION
page 3 of 4
HASC216
UNIVERSITY OF ZIMBABWE
HSTS204/HASC216 LATEX Q6 Article
February 2020
(b)
yij = β0 + βˆ1 xi + β2 xj + ij (1)
α α2
(c) σ = β
σ1 = β6
1
Use it to classify yourself
page 4 of 4