7
7
* the LaTeX source document. *
8
8
* *
9
9
* Lines - *
10
- * 691 *
10
+ * 755 *
11
11
* *
12
12
********************************************************************************
13
13
14
14
*! eda
15
15
*! v 0.0.0
16
- *! 29OCT2015
16
+ *! 30OCT2015
17
17
18
18
// If you don't have the tuples program installed you may want to do that
19
19
// ssc inst tuples, replace
@@ -39,7 +39,8 @@ prog def eda
39
39
QFIT2(string asis) LOWess LOWess2(string asis) FPFIT FPFIT2(string asis) ///
40
40
LFITCi LFITCi2(string asis) QFITCi QFITCi2(string asis) FPFITCi ///
41
41
FPFITCi2(string asis) noBUBBLEplots noBOXplots noMOSAIC noHEATmap ///
42
- COMPile PDFLatex(passthru) SLOw BYGraphs(string asis) BYVars(varlist) ]
42
+ COMPile PDFLatex(passthru) BYGraphs(string asis) BYVars(varlist) ///
43
+ WEIGHTtype(passthru) ]
43
44
44
45
// Make the sample to use for the program
45
46
marksample edause, strok novarlist
@@ -244,8 +245,6 @@ prog def eda
244
245
file write doc " \newpage\clearpage \tableofcontents \newpage\clearpage" _n
245
246
file write doc " \listoffigures \newpage\clearpage" _n
246
247
file write doc " \listoftables \newpage\clearpage" _n
247
- file write doc " \chapter{Graphs} \newpage\clearpage" _n
248
- file write doc " \begin{landscape}" _n
249
248
250
249
// Make sure the data are stored more efficiently
251
250
qui: compress
@@ -265,11 +264,58 @@ prog def eda
265
264
misstable pattern
266
265
*/
267
266
268
- // Add entry for univariate distributions
269
- file write doc " \section{Univariate Distributions} \newpage\clearpage" _n
267
+ // Check for univariate graphs
268
+ if inlist(" " , " `bargraphs'" , " `piecharts'" , " `histograms'" , ///
269
+ " `distroplots'" , " `ladderplots'" ) == 1 {
270
+
271
+ // Add univariate to macro
272
+ loc graphs " univariate"
273
+
274
+ } // End IF Block for univariate graphs
275
+
276
+ // Check for bivariate graphs
277
+ if inlist(" " , " `scatterplots'" , " `bubbleplots'" , " `boxplots'" , ///
278
+ " `mosaic'" , " `heatmap'" ) == 1 {
279
+
280
+ // Add bivariate to graphs macro
281
+ loc graphs `graphs' " bivariate"
282
+
283
+ } // End IF Block to check for graphs
284
+
285
+ // If any graphs are going to be drawn
286
+ if `" `graphs'"' ! = " " {
287
+
288
+ // Add a graphs chapter header and set
289
+ file write doc " \chapter{Graphs} \newpage\clearpage" _n
290
+
291
+ // Check for univariate graphs
292
+ if inlist(" univariate" , " `: word 1 of `graphs''" ) == 1 {
293
+
294
+ // Add entry for univariate distributions
295
+ file write doc " \section{Single Variable Graphs} \newpage\clearpage" _n
296
+
297
+ } // End IF Block for univariate graphs
298
+
299
+ // Check for only bivariate graphs
300
+ else if " `graphs'" == " bivariate" {
301
+
302
+ // Add entry for univariate distributions
303
+ file write doc " \section{Multi-Variable Graphs} \newpage\clearpage" _n
304
+
305
+ } // End ELSE IF Block for multivariable graphs only
270
306
271
- // Add subsubsection header for categorical data
272
- file write doc " \subsection{Categorical Variables} \newpage\clearpage" _n
307
+ // Change the page orientation to landscape
308
+ file write doc " \begin{landscape}" _n
309
+
310
+ } // End IF Block for graphs macro
311
+
312
+ // If Block for categorical variable sub header
313
+ if inlist(" " , " `bargraphs'" , " `piecharts'" ) {
314
+
315
+ // Add subsubsection header for categorical data
316
+ file write doc " \subsection{Categorical Variables} \newpage\clearpage" _n
317
+
318
+ } // End IF Block for categorical variables sub header
273
319
274
320
// Check if user wants bargraphs
275
321
if " `bargraphs'" ! = " nobargraphs" & ! inlist(`catvarcount', 0, .) {
@@ -289,9 +335,15 @@ prog def eda
289
335
290
336
} // End IF Block for pie charts option
291
337
292
- // Add subheading to the LaTeX file
293
- file write doc " \subsection{Continuous Variables} \newpage\clearpage" _n
338
+
339
+ // If Block for continuous variable sub header
340
+ if inlist(" " , " `histograms'" , " `distroplots'" , " `ladderplots'" ) == 1 {
341
+
342
+ // Add subheading to the LaTeX file
343
+ file write doc " \subsection{Continuous Variables} \newpage\clearpage" _n
294
344
345
+ } // End IF Block for continuous variable sub header
346
+
295
347
// Check if user wants histograms
296
348
if " `histograms'" ! = " nohistograms" & ! inlist(`contvarcount', 0, .) {
297
349
@@ -320,9 +372,15 @@ prog def eda
320
372
321
373
} // End IF Block for ladder of power graphs
322
374
323
- // Header for bivariate/conditional distribution graphs
324
- file write doc " \section{Bivariate Distributions} \newpage\clearpage" _n
375
+
376
+ // If Block for bivariate graphs
377
+ if " `: word 2 of `graphs''" == " bivariate" {
378
+
379
+ // Header for bivariate/conditional distribution graphs
380
+ file write doc " \section{Multi-Variable Graphs} \newpage\clearpage" _n
325
381
382
+ } // End IF Block for bivariate subheader with univariate graphs
383
+
326
384
// Check for scatter plot option
327
385
if " `scatterplots'" ! = " noscatterplots" & ! inlist(`contvarcount', 0, .) {
328
386
@@ -380,9 +438,15 @@ prog def eda
380
438
} // End IF Block for correlation heatmap option
381
439
382
440
383
- // Change back to portrait page layout
384
- file write doc " \end{landscape}" _n
441
+
442
+ // If any graphs are going to be drawn
443
+ if `" `graphs'"' ! = " " {
444
+
445
+ // Change back to portrait page layout
446
+ file write doc " \end{landscape}" _n
385
447
448
+ } // End IF Block to reorient pages after graphs section
449
+
386
450
// Create next section/subsection headers
387
451
file write doc " \chapter{Descriptive Statistics} \newpage\clearpage" _n
388
452
0 commit comments