Professional Documents
Culture Documents
STATISTICAL COMPUTING 2
May/June 2017
Time : 2 hours
Candidates should attempt ALL questions in section A and 2 questions in section B. Marks
will be allocated as indicated.
A1. (a) Give two advantages of LATEX over word processors when typesetting
scientific documents. [2]
(b) Define the preamble making reference to a LATEX document. [2]
(c) Differentiate between an environment and a command in LATEX. [3]
A2. (a) How do you create a field in the EPI INFO form designer? [2]
(b) Describe any 3 types of variables in EPI INFO. [3]
(c) Give any two data formats you can get using EPI INFO export facilility. [2]
A3. (a) Describe the five STATA windows you get when you start up STATA. [5]
(b) Differentiate a do-file and a log-file in STATA. [4]
(c) What commands do you type to change your working directory in R and in
STATA? [2]
page 1 of 4
HSTS204
(c) Define the term ‘whitespace’ as used in programming language, and give two
examples of whitespaces in C programming language. [1,2]
B5. (a) Briefly describe the effects of each of the following LATEX
commands/environments;
(i) \noindent
[1]
(ii) \[ \]
[1]
(iii) \vspace{2cm}
[2]
(iv) \begin{verbatim}
\ end{verbatim}
[2]
(v) \begin{equation}\label{Eqn2}
y= X\beta
\end{equation}
[2]
(vi) \title{HSTS204 STATISTICAL COMPUTING 2 EXAMINATION}
\author{FirstAuthor\\SecondAuthor}
\date{June 2017}
\maketitle
[2]
(vii) \begin{center}
\begin{figure}[htbp]
\includegraphics[width=4in]{filename}
\caption{My Graph!}\label{trialgraph}
\end{figure}
\end{center}
[5]
(viii) \begin{tabular}{|l|c|c|c|r|}\hline
&\multicolumn{3}{|c|}{Values}&\\\hline
&1&2&3&\\\cline{2-4}
4&5&6&7&8\\\hline
\end{tabular}
[5]
(b) Give the R commands to input into the workspace memory the matrix A =
1 1 2
0 2 2
. [5]
1 0 1
1 4 1
page 2 of 4
HSTS204
(c) What command would you type in R to save your workspace? [1]
(d) What command would you type in R to save load a package? [1]
(e) What command would you type in R to get summary statistics for all the variables
in a dataframe? [1]
(f) Differentiate between the two R help commands help("keyword") and
help.search("keyword") [2]
B6. (a) Describe the 7 tabs you get when you call the EPI INFO program. [7]
(b) LATEX is an environment where mathematical and statistical formulae can easily
be typed and referenced. Specify the commands that would be used in LATEX
to:
(i) Input the referenced equation
[3]
(ii) Input an inline equation, ŷi = β̂0 + β̂1 x [3]
(iii) Typing the following characters:
(a) # [1]
(b) ` [2]
(c) \ [2]
(d) ˜ [2]
(c) Explain each of the elements of the standard STATA syntax:
[by varlist:] command [varlist] [=exp] [if exp] [in range]
[weight] [using filename] [,options]
[9]
(d) Which elements are required in a STATA syntax? [1]
page 3 of 4
HSTS204
END OF EXAMINATION
page 4 of 4