Difference between revisions of "User:Kbjarkefur"

Jump to: navigation, search
Line 15: Line 15:
This part is using the regular <nowiki><code></nowiki> tag which is great when writing code in the middle of a sentence:
This part is using the regular <nowiki><code></nowiki> tag which is great when writing code in the middle of a sentence:


'''Ex.1''' Use the 'egen' function <code>rowtotal()</code> when aggregating variables.
'''Ex.1''' Use the ''egen'' function <code>rowtotal()</code> when aggregating variables.


However, the <nowiki> <code></nowiki> tag is not great when writing multiple lines of code because there is a space in the formatting between the lines.
However, the <nowiki> <code></nowiki> tag is not great when writing multiple lines of code because there is a space in the formatting between the lines.
Line 22: Line 22:


<code>
<code>
gen varA = .
gen varA = .<br>
 
replace varA = 1 if gender == 1<br>
replace varA = 1 if gender == 1<br>
replace varA = 0 if gender == 0
replace varA = 0 if gender == 0
</code>
</code>

Revision as of 21:11, 26 October 2017

About me

Pages on this wiki I frequently need:

Code snippet example

This part is using the regular <code> tag which is great when writing code in the middle of a sentence:

Ex.1 Use the egen function rowtotal() when aggregating variables.

However, the <code> tag is not great when writing multiple lines of code because there is a space in the formatting between the lines.

Ex.2

gen varA = .
replace varA = 1 if gender == 1
replace varA = 0 if gender == 0