The thing with labels in Stata is that help label doesn't tell you about ... labelbook. Labelbook is just great, not only in itself, as it is not much better than a sequens of describe var and label varlabel(var), but because there is the uselabel command that turns a label into a editable dataset. This is very handy indeed, for example when you want to merge labelnames into a dataset. I used to go with workarounds collapsing the variable and an encoded form, but that's unpractical.
A few nice standard options in stata is to prefix the code before a label and to set labels in several languages. I've programmed my way around using macros, but now it seems it shouldn't have done that.
When searching for labelbook - because I knew it existed in some form - I installed varlab, rensheet, and varutil. The first two seem utterly useless, the third one does not have a central help file, it is rather a collection of commands writting by Nick J. Cox, so certainly very valuable.
Posts tonen met het label software. Alle posts tonen
Posts tonen met het label software. Alle posts tonen
maandag 15 april 2013
maandag 25 februari 2013
Another tongue for BibLaTeX
This is a post in English, about getting LaTeX to speak Dutch. As such, it may be interesting for other rare languages.
In my last post I discussed the awkward natbib package. That was pretty bad. Now natbib is actually the old fashioned way of referencing. The advantage: it does the job for simple tasks. The disadvantage: everything else. So here's the hip new way of referencing: biblatex.
Yes, I'm being a cynic here. It's a big mess again. But for all of you who like a decent walkthrough, here you are.
In my last post I discussed the awkward natbib package. That was pretty bad. Now natbib is actually the old fashioned way of referencing. The advantage: it does the job for simple tasks. The disadvantage: everything else. So here's the hip new way of referencing: biblatex.
Yes, I'm being a cynic here. It's a big mess again. But for all of you who like a decent walkthrough, here you are.
Compiling BibTex
First of all, biblatex relies on the biber code, not bibtex. This means that you have to reset your editor to instruct biber where it asks for the bibtex path. Obvious? Not at all. I use TexMaker.- On a Windows machine: options > configure TM > commands > bibtex %
- On the Mac: same, ending in > usr/texbin/bibtex % (or something like that. No .aux!)
Next, you'll need a sequens of parsing. I do this, repeating step 2 and 3 twice if it doesn't work the way I expected.
- pdflatex
- bibtex
- pdflatex
- view pdf
Note that you can define the parsing sequens as a user command in TexMaker/TexStudio.
Citing in line and bibliography
Ok, so let's turn back to your .tex file. You'll basically need this syntax in the preamble (before \begin{document}:
\usepackage[american]{babel}\usepackage{csquotes}\usepackage[style=apa, natbib=true]{biblatex}\DeclareLanguageMapping{american}{american-apa}%\addbibresource{/Users/username/folder/database.bib} %MAC\addbibresource{D:/folder/database.bib} %PC
There's no need to specify backend=biber in the biblatex options, yet it does no harm. The standard style is numeric, an alternative is authoryear-comp, or you can follow some journal style, like the APA in this case. Because of the biblatex-apa call here, we need babel, csquotes and \DeclareLanguageMapping. You can change american for a language of your choice, such as dutch, german or french. Do this everywhere it appears in this block of syntax. Do not use multiple languages. This is a shame, as many non-English authors may want to quote in English. Well, you can't.
In the body of your text, after \begin{document} you use the biblatex commands \cite, \textcite and \parencite, or the old natbib commands \cite, \citet and \citep for reasons of compatibility or demands from the publisher. To make the latter work, I specified the option natbib=true. there are a number of other options, such as the suppression of urls and ISBN or DOI numbers, you may want to add.
Before \end{document}, you put \printbibliography. This generates a bibliography, with appropriate translation: 'october' (EN) becomes 'oktober' (NL) in datas, 'references' becomes 'referenties' as heading, etc.
It took me a full day to find this out. I hope you found this post quick enough to keep some time for the real work.
End note
If along the way you get stuck, three things you may want to do:
- Update your editor and your packages. Use TexLive. It's a fat ugly program, but it's made to be updated (the program you need is texutility on OS X and tl-tray-menu on windows)
- Restart your editor. Sometimes it remembers old lines for no reason.
- Erase all latex files except the database (.bib), the text (.tex) and maybe the pdf to save your ass if you miss out on the first two.
vrijdag 22 februari 2013
BibTeX (natbib)
The much praised reference program BibTeX is an essential part of all academic LaTeX work. It took me some time to understand what it does. You should keep the following sequens in mind:
- First you process an .aux file from you .tex text using LaTeX (i.e. compile > LaTeX)
- That thing is full of code you need to parse through BibTeX to turn the reference fields into references (i.e. compile > BibTeX)
- Doing each step twice may be a good idea to get cross references right
- Next, you parse again using LaTeX
- Finally, you parse the whole thing using pdfLaTeX, to get a pdf (it's a miracle...)
You will agree with me that this is a very cumbersome operation. It is one of the reasons I would recommend using Zotero with a word processor plugin, if you don't really need LaTeX.
But it gets worse. This is how you set up your .tex file.
- In the preamble, so before \begin{document}, you need to load the BibTeX package. The old and safe way is \usepackage{natbib}. It seems there is a new and more flexible BibTeX connection called biblatex. So you heard it right: natbib won't let you make bibliographies for chapter, for example. Whence the praise, I wouldn't know.
- Also in the preamble, although some write it elsewhere, you need to mention the bibliography style. It is \bibliographystyle{plainnat}. In some sciences, this is just plain, and for some journals this will be a specific style. You can't modify this, as the .sty files with the definition are very hard to decypher. LaTeX guys would say: 'Why would you?' Honestly, because I like simple languages. I use Stata instead of SAS, and that's why.
- Obviously, in the standard format, you'll want your bibliography at the end. That's where you'll have it, just type \bibliography{library path}. Library path may be just the name of the library if it's in the same folder, but if you have a copy of your Zotero or Mendeley library at a fixed place, you should give the full path, and beware not to have spaces in it. Also, change backslash for slashes. Usability, you know?
Having gone through all that, you may want to start quoting. Luckily, that's the good part. You need not click any buttons, just type \cite{ and you have a list of labels to choose from. The handy thing is the AutoZotBib plugin for Zotero simply labels entries with the name of the first author, the first word of the title and the year. So it's pretty easy to call in your references. There's a few elegant options to quote:
- \citep{ : this numbers references, if you like that. If you care less about names, do it wiki-style.
- \citeauthor{ : obviously, you'll just get the author
- \citeyear{ : well... you get it
So in sum, it's a pain in the ass, but it works.
One note: you may have weird characters in your references, like Swedish names. You know that LaTeX is English based so you may go down because of your Swedish friends. I haven't really figured out yet, I will in time, but maybe some fontpackage, such as \usepackage[T1]{fontenc}, may help you out. Good Lord, this ain't how it was meant to be.
Good luck referencing!
Good luck referencing!
woensdag 5 september 2012
Cornell on statistical packages and Ethan Fosse's blog
This guy, Ethan Fosse, is a sociologist who uses R. Instead of Stata. Picture this. He does know a lot about graphics but I particularly liked this corner of the blog where he points to unsolved questions in sociology. Rising inequality in any field is one such question that intriges me too. Interesting readings. Found it through this R blog (Revolutions), when I was actually looking for sociologist using Stata. And yes, it's what people at Cornell recommend to learn first. I quote:
General Purpose Software
Quantitative data analysis in sociology is dominated by three all-purpose programs, Stata, SPSS, and SAS. All three are available on Cornell's Athena computer cluster, and all three are excellent.
We typically recommend that graduate students learn Stata first. SPSS has some attractive features, but it has been losing ground to the other two for the past 15 years. Although SAS is the most comprehensive, it has a relatively inefficient programming language. Stata is almost as comprehensive as SAS, and it has a much more efficient programming language. And, if you need one of the special routines that SAS offers but Stata does not, you will often end up using a more specialized computer program anyway because even SAS is not quite as good as the specialized software (see below). Nonetheless, SAS is particularly well-suited for very large datasets, and SAS is also the dominant package for the federal government. If you work with many types of government data, you will find that the best supporting documentation is written for SAS users.
UCLA statistical computing has the best (we think) on-line set of resources for these three programs. See http://www.ats.ucla.edu/stat/. Also, Cornell's CISER offers tutorials for all three programs. Seehttp://www.ciser.cornell.edu/ASPs/workshops.aspx.
Infographics
To us, researchers, two opposites demand always pop up:
- Be precise
- Make science look fun
In order to lean a bit more towards the latter, people created infographics and infographics tools. It's like the kind of graphs you read in newspapers or on posters. You may get close to the chart itself if you're really handy with Stata, but it takes way to much time for the simple chart you get. There are many tools that may do that easier and better. There are also much more artistic contribution you'll read about on the cool infographics blog. And be sure to check out this Swiss website on data visualizations.
The drawback: which tool will do what you want and exactly what you want? Basically, you need to be able to customize and add data. That brings you terribly close to Stata, doesn't it. Yet sometimes, these tools will really make it happen:
- Tableau: it's the more sophisticated package, available in a free ("public"), paid desktop and server version. You get it. Consultancy stuff. Basically it's all about two axis and a third dimension expressed in colours or size of dots. Also has annoying interactive dashboards we do not need.
- Many eyes: it's IBM software, so it should eventually find its way into SPSS. Nice charts, hard way to get there though. Worth a try and looks professional.
- Infogr.am: I haven't really figured out. It makes nice graphs, most importantly including the matrix charts I love (coloured little people representing counts). It's beta and buggy at the moment, and quite inflexible. Like how on earth do you change the shapes in the matrix chart? I do not know.
- Pik to chart: this is only the lay-out part: nice fonts, few charts really.
Word clouds and social media
Network visualizations
- Gephi: network visualizations. I don't do that. Much like Graph Viz, but I suppose more intuitive.
dinsdag 14 augustus 2012
Shige's Research Blog: Mplus vs. Stata for Heavy Computation
Golden tip (from 2006)
Do the basic stuff with basic Stata and the heavy stuff with Mplus, which has the same price no matter how many cores your processor has.
Shige's Research Blog: Mplus vs. Stata for Heavy Computation
Do the basic stuff with basic Stata and the heavy stuff with Mplus, which has the same price no matter how many cores your processor has.
Shige's Research Blog: Mplus vs. Stata for Heavy Computation
dinsdag 11 oktober 2011
Alternatives to ... Powerpoint
I wasted some time looking around for Powerpoint alternatives. Basically, my conclusion is: don't do that. It's not because Powerpoint is such a great program, but rather because the alternatives have limitations which are more serious than the rightly criticized linearity of Powerpoint.
Anyway, what to expect:
Anyway, what to expect:
- [Sozi] It's open source and entirely vector based. It would make for a good banner or a graphic scheme you want to discuss focussing on the composing parts. *
- [Vue] The best alternative in my view, which lets you construct different paths over the slides and insert midway overview in the presentation where you can get off road. A good idea, but not very user friendly. ***
- [Prezi] This is very good looking software, but it has some major drawbacks. First of all, it's all flash and therefore heavyweight. Any animations you include need to be flash movies, which are very hard to make. The choice of slide templates is limited and customization options do not really help you out. There is a svg-alternative in the making, but that means it is currently useless. **
- [ahead] As Prezi, but better looking. Spend some time and impress your audience. Not for quick tasks and only online. ****
- [Zoho] As Powerpoint, but online and owned by Google. **
woensdag 31 augustus 2011
Alternatives to ... kladblok
Precies omdat andere programma's zo complex en lomp worden, is kladblok vaak zeer handig en zelfs de redder in nood. Maar er zijn toch een aantal andere programma's die mooie extra's toevoegen en toch eenvoudig blijven:
- [Notepad++] Gebruik ik op dit moment. Bevat alle nodige functies en woordenboeken voor elke programmeertaal.
- [Crimson Editor] Gebruik ik niet meer omdat het niet meer vernieuwd wordt.
- [Textpad] Is een sterk programma, maar toont af en toe pop ups tot je betaalt.
- [ConTEXT] Geïnstalleerd maar ik gebruikte het niet.
- [Bluefish] Heb ik geïnstalleerd maar het werkt niet. Zou goed moeten zijn om online bestanden in webformaten aan te passen.
Ze laten toe reguliere expressies te gebruiken voor zoek- en vervangopdrachten, bieden syntax highlighting voor veel programmeertalen, openen bestanden in tabs, werken deze bij als ze in een ander programma werden gewijzigd en hebben een blokselecteerfunctie.
Voorbeeld van het gebruik van reguliere expressies:
http://www.ozzu.com/mswindows-forum/repalce-character-with-carriage-return-line-feed-t56436.html
Als je denkt als een typemachine is de newline instructie \n\l eenvoudig:
Voorbeeld van het gebruik van reguliere expressies:
http://www.ozzu.com/mswindows-forum/repalce-character-with-carriage-return-line-feed-t56436.html
Als je denkt als een typemachine is de newline instructie \n\l eenvoudig:
- \n vraagt een nieuwe lijn
- \r zet de cursor terug bij het begin van de lijn (return)
Office 2007, pdf's en algebra
Wanneer "vreemde en complexe" lettertypes niet geïnstalleerd zijn, zal de functie 'opslaan als pdf' in de Office-programma's niet werken. Oplossing: print met een pdf-printer (pdf995) of installeer de lettertypes.
httpBericht publiceren://help.lockergnome.com/office/Problems-equations-Word-2007--ftopict943892.html
httpBericht publiceren://help.lockergnome.com/office/Problems-equations-Word-2007--ftopict943892.html
dinsdag 15 maart 2011
Stata and Excel in Europe
Say it like it is, Stata is a very good program but it is not user-friendly. Even less so when you haven't quite got the same decimal/thousands separators in your native style.
After searching way too long for a solution, I found that we have to live with it. Like this:
http://www.stata.com/statalist/archive/2003-05/msg00353.html
After searching way too long for a solution, I found that we have to live with it. Like this:
http://www.stata.com/statalist/archive/2003-05/msg00353.html
dinsdag 9 november 2010
Kladblok voor gevorderden
Vroeger was ik fan van Crimson Editor, maar aangezien de ontwikkeling is stopgezet, ging ik verder met Notepad ++.
Voordelen
Voordelen
- Geen tekstopmaak, dus geen nutteloze markup. Zeer nuttig bij het copy-pasten uit websites.
- 'Mono(space)' of 'console'-lettertypes voor een vaste letterafstand
- Syntax highlighting voor statistische programma's (soms moet je een plugin inladen)
- Verticaal tekst selecteren (kolommen)
- Gratis
donderdag 21 oktober 2010
LaTeX Tables
updated September 2013
I am not a big believer of LaTeX, but I do use it. One reason to dislike LaTeX is the way you need to make tables. It is very easy to mess up and very hard to debug.
From your stats package to LaTeX
My workflow is the following: make every table with just data in Excel, then convert using excel2latex and paste it in your .tex file. If you happen to have crazy formulas in your table, do the same but use codes in your excel table which you then replace by the formulas in LaTeX.
Do not, as a rule, use tabout-like output that Stata delivers. I prefer a little adjustment of Excel matrix output, which is good nowadays, over the burden to look into the LaTeX puzzle. Face it: when we use tables, it's generally for several models or with a combination of different analyses. So for me -tabout- is worthless.
Adjustments to LaTeX tables
The standard LaTeX-layout, which is good enough, has very large margins. That's nice, but it limits your tables. To cope with that, I've read about two solutions:
- The tabularx package
- Put the table inside a minipage and scale it to fit
We're left with just a few more issues:
- Landscape pages (fear, anger, hate!)
- Wrapping lines
- Wide tables (through -tabularx-)
Wrapping lines I've done. It's cumbersome. Basically, you will want to limit the size of a column. You do that through specifying p{3 cm} in your {l l l c r r r c} series of column specifications, where each of l, r, c refers to a column that is left aligned, right aligned or centered. p{} replaces such a specification, so you lose your control over alignment! To solve this issue, you need yet another package: arrays. Then, and I'm not joking, your wrapped left aligned column should be specified as:
>{\raggedright\arraybackslash}p{width}
It is really that stupid. Never saw a > in LaTeX syntax before? Neither did I. As always, there will be some logic behind it, for which a Ph.D. level IQ will suffice, but even if it is understandable, we don't want to waste our time figuring out.
Links
If you don't want to google, hit some old bookmarks (2010):
- http://programming.itags.org/tex/126082/
- http://www.latex-community.org/forum/viewtopic.php?f=45&t=5089
- http://radio.wihome.net/wiki/?article=LaTeX:tablefootnotes
- http://www.vision.ime.usp.br/~jmena/misc/latex/tables_with_latex.pdf
- http://www.latex-community.org/forum/viewtopic.php?f=45&t=6322&p=24742
- http://www.math.uiuc.edu/~hildebr/tex/packages.html
- http://people.csail.mit.edu/jrennie/latex/
donderdag 14 oktober 2010
Reference managers
This post has been updated 9 November 2013: added JabRef
Routine work should be automatized. I remember writing my master thesis using a not so legal copy of Endnot X, which had a terrible memory leak. As a result, I had to restart my computer every hour - which took about 10 minutes! I didn't smoke cigarettes, so what a waste of time... However, the best part of my thesis was probably the bibliography.
Today we get all the fun for free. You may get rid of your boxes of EndNote and Reference Manager. They're too expensive and little innovative. There are two fresh, hip reference managers that rule the scientific world nowadays: Zotero and Mendeley. There is an additional and traditional tool I use with them when doing LaTeX-work: JabRef. I discuss pro's and cons, so you should understand why I choose for Zotero. Both are excellent research tools, but the functionality sticks to managing references. There may be broader tools to manage all of your research, such as One Note or Citavi. I don't know these programs and I am not a big believer.
Routine work should be automatized. I remember writing my master thesis using a not so legal copy of Endnot X, which had a terrible memory leak. As a result, I had to restart my computer every hour - which took about 10 minutes! I didn't smoke cigarettes, so what a waste of time... However, the best part of my thesis was probably the bibliography.
Today we get all the fun for free. You may get rid of your boxes of EndNote and Reference Manager. They're too expensive and little innovative. There are two fresh, hip reference managers that rule the scientific world nowadays: Zotero and Mendeley. There is an additional and traditional tool I use with them when doing LaTeX-work: JabRef. I discuss pro's and cons, so you should understand why I choose for Zotero. Both are excellent research tools, but the functionality sticks to managing references. There may be broader tools to manage all of your research, such as One Note or Citavi. I don't know these programs and I am not a big believer.
Zotero
This program meets your needs. It integrates seamlessly with Word 2007 and syncs its catalogue (the references) with your free account at the Zotero server. Data can be synced with the Zotero server or your WebDAV server of choice. I use 4shared.com.The good
- Elegantly exports to many formats, including the files in a nice way. As a consequence, you can always return on your steps and use your old reference manager.
- Neat integration in all major webbrowsers
- BibTeX can be synced using the AutoZotBib plugin and the Spartan or the RobinTan translator.
- It is open source
The bad
- Each file has its folder and folders have nonsensical names, ruling out the use of Explorer
- Interface is old fashioned, ineffective
- Automatic indexing is lagging pdf import and unintuitive to turn of
- Doesn't sync with Mendeley: you should work via RIS files that include the file path.
Mendeley
A proprietary copy of Zotero, that should sync with it, as well as with a BibTex-file, zo it could act as a bridge between those programs. The file manager is neat, quick and accurate. I regret Zotero doesn't sync back, so I could do part of the job in Mendeley. Mendely offers 1000 MB free cloud storage, which is nice. Prices go up after that, but for lightweight users, it may be a good deal.The good
- It syncs with Zotero. However, for large sqlite.data files, this becomes cumbersome and slow, as the syncing is continuous.
- It natively syncs with a BibTex file, which is very good
- The interface is nice and let's you read pdfs in the left pane, while having the reference column to the left.
- You can always revert your decision, via RIS files as said before
- Search results go quite deep into the references and are neatly shown
The bad
- The browser integration is limited to a bookmarklet. This means you have to press and see whether you can import straight from the browser. If you do, you only download to your Mendeley account. Importing to your desktop program is a second step. I understand the cloud approach, but soon you'll leave free territory (considering a HD as free storage).
- A deal breaker: there is no way to sort search results! What if you want a chronological overview by author? What if you want to see what journals were published in? These are common desires!
- The thing with syncing large libraries.
- It's proprietary and they've slowed down on updates.
JabRef
JabRef is a totally different breed from the first two. It is to Mendeley/Zotero what TexMaker is to Word. You basically get a list with references, screen wide, optionally linked to fixed folder paths.The good
- It's blazing fast to open and quick to search through.
- Your database is a text-file, there is nothing to slow it down.
- It's a bibtex file, which all software can read and what you need in LaTex.
- Put it on Dropbox, google Drive, and the like, and you are always in sync.
- You choose an appropriate bibtex key you will remember.
The bad
- It doesn't auto-catalog, manage, or rename pdf files.
- If you use several bibtex files, it is not obvious to move references from one to the other, except by export/import.
- It doesn't auto-create the bibtex keys.
- It doesn't ocr for references.
Workflow
I use Zotero and JabRef. Zotero manages my literature in the same way iTunes manages my music collection. It is useful though, to make/export a small bibtex file when you finished a paper. It's faster and it secures your references. Also, sometimes Zotero skrews up the references (say, names with multiple uppercase characters), and you can solve this in JabRef.A few ways to make the most use of Zotero:
- Make a dump folder for new documents. I do this by quarter.
- Use three kinds of tags:
- Some generic terms: TO DO, CLASSIC, STARS
- The paper's keywords or theme
- Some nickname, or the project or institue the paper comes from
- Use the notes, but do not overinvest in this, because it is too software specific and you'll lose notes and folders one day for sure. I generally give up why I downloaded a paper or who sent it to me.
- Do not catalog other things than literature. It could replace explorer, but you'll waste your time.
- Make a folder for each project, with two subfolders: a) literature, and b) references. In references, you keep what you reference to in the paper.
- If you write several papers, make several references folders.
- Export the references folders to bibtex for survival. Polish with JabRef, and edit the bibtex files when you later pick up the work on the paper. By then, your library will have changed and will mess up your paper.
- Example of the latter: Zotero auto-assigns bibtex keys, say AuthorYearA/B/C. If more articles are imported, those will change and you'll be miserable.
Some non-workflow related hints:
- Use a cheap WebDAV server to sync. It works well, won't mess up your database like dropbox would.
- Go through the pain of setting up Firefox if you're on mac.
- Solve the Bibtex export problems.
- Spent your free time tidying up your database. It's your comparative advantage.
Online sources
- Wikipedia [-] http://en.wikipedia.org/wiki/Comparison_of_reference_management_software
- Zotero [-] http://forums.zotero.org/discussion/6174/mendeley/
- Zotero [-] http://forums.zotero.org/discussion/6527/
- Mendeley [-] http://www.mendeley.com/blog/tag/zotero/
- Blog [2011-02-02] http://nakhmani.wordpress.com/2011/02/02/mendeley-vs-zotero-comparison/ (about the notes editor)
- Blog [2012-02-12] http://onid.chrislott.org/2012/in-brief-mendeley-vs-zotero-for-citation-management/ (about pricing)
- Blog [-] http://jodischneider.com/blog/2009/08/27/organizing-a-pdf-library-mendeley-for-information-extraction-zotero-for-open-source-goodness/ (fouten bij 'retrieve metadata' in beide programma's)+
- Blog [-] http://earlycj5.wordpress.com/2009/03/20/zotero-vs-mendeley-initial-thoughts/
- Blog [-] http://dave.langers.nl/index.php?/archives/408-Zotero-vs.-Mendeley.html
- http://groups.google.com/group/latexusersgroup/browse_thread/thread/ecef859dd30e306c?pli=1 (metadata toevoegen in LaTeX)
- http://www.tumblr.com/tagged/zotero+mendeley
- http://alternativeto.net/software/mendeley/comments
- http://ubuntuforums.org/archive/index.php/t-1067681.html
- http://infopolitics.net/2010/07/things-i-want-in-an-academic-writing-workflow/
- http://hlwiki.slais.ubc.ca/index.php/Zotero_vs._Mendeley
- http://www.slideshare.net/giustinid/ref-works-mendeley-zotero
woensdag 13 oktober 2010
LaTeX
Update 20-06-2013
Eén: een 'parser', een programma dat de code omzet in - laten we zeggen - een pdf'je. Dat kan MikTeX zijn of TexLive. Het komt allemaal op hetzelfde neer. Je moet wel de toepassing tex.exe weten te localiseren (onder Windows). Ik heb TexLive geïnstalleerd om alternatief te doen.
Twee: een frontend of editor. Dat kan bij wijze van spreken kladblok zijn, maar het is interessanter om een programma te gebruiken waar bijvoorbeeld knoppen met shortcuts voor bepaalde commando's reeds in aanwezig zijn en waar je met een muisklik het document kunt naar de parser sturen. Ik gebruik hiervoor TexMaker. Meer populair is TexnicCenter, en voor sommige mensen de tussenslag LyX, die reeds een indruk geeft van je output. Ter vergelijking: in Word zie je quasi exact de uiteindelijke output.
Mijn ervaring:
Tweede nadeel: cite while you write blijft een beetje klungelig, want je moet in de .bibtex-file keys bepalen voor de referenties. Vanuit Zotero wordt dit automatisch gedaan, maar afhankelijk van de gebruikte plugin krijg je andere keys. Die zijn te manipuleren in JabRef, maar dit kan in feite enkel op het laatste moment wanneer je een definitieve, en paper specifieke referentielijst hebt, zoniet wordt je werk toch telkens overschreven.
Derde gigantische nadeel: tabellen. Probeer in HTML een tabel te maken: dat gaat niet. In LaTeX is het net zo. Je doet er dan ook best aan om te werken via Excel en een plug-in. Dat voorspelt wel problemen, uiteraard. Enkele links:
Probleem
Na heel wat uren turen onder de Office-motorkap blijven veel problemen onopgelost. Vooral Word werkt soms tegen:- Nummering van hoofdstukken en secties
- Insluiten van vectorafbeeldingen
- Dimensies van tabellen
- Cross references naar tabellen en grafieken
- Inhoudstabellen
- Paginanummering, first pages en secties
- Paginadimensies, illustraties
- Compatibiliteit illustraties in Excel, Powerpoint en Word
- ...
Met andere woorden, het is een boeltje. Ondertussen hoor je dat er een markuptaal bestaat die al die zaken onder controle houdt, LaTeX. Ik experimenteer daar ondertussen al even mee.
Het systeem
Zoals veel dingen uit de alternatieve wereld van computernerds zijn de interfaces van de programma's onoverzichtelijk en is de installatie al meteen problematisch. In essentie heb je twee programma's nodig.Eén: een 'parser', een programma dat de code omzet in - laten we zeggen - een pdf'je. Dat kan MikTeX zijn of TexLive. Het komt allemaal op hetzelfde neer. Je moet wel de toepassing tex.exe weten te localiseren (onder Windows). Ik heb TexLive geïnstalleerd om alternatief te doen.
Twee: een frontend of editor. Dat kan bij wijze van spreken kladblok zijn, maar het is interessanter om een programma te gebruiken waar bijvoorbeeld knoppen met shortcuts voor bepaalde commando's reeds in aanwezig zijn en waar je met een muisklik het document kunt naar de parser sturen. Ik gebruik hiervoor TexMaker. Meer populair is TexnicCenter, en voor sommige mensen de tussenslag LyX, die reeds een indruk geeft van je output. Ter vergelijking: in Word zie je quasi exact de uiteindelijke output.
Mijn ervaring:
- LyX: nutteloos, je kan de LaTeX code niet wijzigen (!)
- TechnicCenter: oeverloos, er komt geen einde aan de foutmeldingen, zelfs voor een goede file
- TexMaker: heel erg goed, overschrijft je pdf's en je opent ze met de interne viewer in no time
Voordelen
- Het ziet er goed uit - je hebt standaard een heel wetenschappelijke stijl, en met XeTeX wordt het zelfs artistiek.
- Systematiek is heilzaam.
Nadelen
Eerste grote nadeel: samenwerken. Iets als track changes bestaat wel, maar ik durf mij er eerlijk gezegd niet aan wagen, laat staan om iemand anders te dwingen LaTeX te begrijpen.Tweede nadeel: cite while you write blijft een beetje klungelig, want je moet in de .bibtex-file keys bepalen voor de referenties. Vanuit Zotero wordt dit automatisch gedaan, maar afhankelijk van de gebruikte plugin krijg je andere keys. Die zijn te manipuleren in JabRef, maar dit kan in feite enkel op het laatste moment wanneer je een definitieve, en paper specifieke referentielijst hebt, zoniet wordt je werk toch telkens overschreven.
Derde gigantische nadeel: tabellen. Probeer in HTML een tabel te maken: dat gaat niet. In LaTeX is het net zo. Je doet er dan ook best aan om te werken via Excel en een plug-in. Dat voorspelt wel problemen, uiteraard. Enkele links:
- http://librecono.wordpress.com/2006/12/27/using-spreadsheets-to-create-latex-tables/
- http://www.ece.cmu.edu/~pueschel/teaching/guides/guide-tables.pdf
- http://blog.dreasgrech.com/2010/02/converting-excel-tables-to-latex-tables.html
- http://www.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf
- http://tug.ctan.org/tex-archive/info/lshort/english/lshort.pdf
- LaTeX & Stata: http://privatewww.essex.ac.uk/~griene/StataLatex.html
- Workflow: http://tex.stackexchange.com/questions/1517/workflow-for-reviewing-pdfs-generated-from-tex
Voor het gebruik van booktabs moet je in de 'preamble' of 'head' de volgende lijn toevoegen:
\usepackage{booktabs}
Vierde nadeel: als er een fout in de code zit, krijg je geen output. Begin dan maar te debuggen.
Nog kritiek:
Nog kritiek:
Links
- http://www.math.duke.edu/computing/tex/templates.html
- http://happymutant.com/latex/ - a quick and dirty guide to LaTeX
- http://people.cs.kuleuven.be/~dirk.nuyens/thesislayout/ - een thesis maken in LaTeX (waarschuwt voor a4wide en raadt geometry aan)
- http://latex.ugent.be/ - fantastische latex site van de Ugent
- http://www.andy-roberts.net/misc/ - man met cursussen
- http://www.andy-roberts.net/misc/latex/latexvsword.html - zinloze bijdrage
- http://happymutant.com/latex/index.html#fonts - A Quick & Dirty Draft Course
dinsdag 24 augustus 2010
SPSS
I am a long time user of SPSS. For many years, it was all I knew, and I managed to write fairly complex macros in SPSS 16. Then I needed to make a lot of very similar graphs, looping over groups, and it just didn't do the job. That's when I switched to Stata and never looked back.
Because of collaboration and to convert very large datasets to SAS and Stata, I may use it every now and then. We have SPSS 20 and it is a little improved, having syntax highlighting and a more stable feel. The looks on the other hand are just childish and the language remains cumbersome.
The SPSS code manual is not very well organized. For help, you'd want to go to the UCLA website or to the SPSS forum. I do not post there anymore though.
Because of collaboration and to convert very large datasets to SAS and Stata, I may use it every now and then. We have SPSS 20 and it is a little improved, having syntax highlighting and a more stable feel. The looks on the other hand are just childish and the language remains cumbersome.
The SPSS code manual is not very well organized. For help, you'd want to go to the UCLA website or to the SPSS forum. I do not post there anymore though.
donderdag 29 juli 2010
WEKA
I don't know what it is, but it's free:
http://www.cs.waikato.ac.nz/~ml/weka/index.html
http://weka.wikispaces.com/
http://weka.sourceforge.net/explorer_screenshots/PreprocessPanel.png
http://www.cs.waikato.ac.nz/~ml/weka/index.html
http://weka.wikispaces.com/
http://weka.sourceforge.net/explorer_screenshots/PreprocessPanel.png
What stats package to use?
Introduction
Boys like their toys, and this is not different with statistical packages. It's a perpetual and heated debate and when you've landed at some point and think your workflow is good, technology passes you and sets you back.
Here's an old discussion that I first consulted, but below I make my own considerations. In short: I'd use Python for big data, Stata for analysis, and R if I have to (e.g. for some graphs). Everything else I would ditch.
Stata
Stata is my program of choice. It is quite expensive, but mind you that for a couple of hundred euros, depending on the flavour, you'll not only get an easy and robust statistical software package, but also fast support, a good community, useful user commands, and a great documentation source. Fun fact: all documentation is read by the wife of the founder, who's not a statistician but perhaps even smarter. If she doesn't understand what the statisticians are saying, it goes back to the drawing board.
The bad things: forget about ever copy-pasting anything. You'll also need to have a lot of memory on your computer, as Stata loads the whole file and just one at a time (although you can 'preserve' a file temporarily to work on something else in between).
Python
Python is the next language I will learn. I have used chunks without understanding what I was doing, but I like the sound of the language, and it's the logical step-up after Stata, it seems. Many people are using it and so will I.
R
I don't like R. There is a thorough discussion here, circling around leaving Stata for R, but ending up in concluding what I conclude about: R is a mixture of a coding language like Python and a statistical language like Stata, but because it is open source the support is unsure, the community tends to be geeky and unfriendly, the documentation is poor, and the language consistency - even if the structure is good because it is a programming language - is bad. Some commands have their own inner programming language and that is plain bad.
The good things: it is free and R Studio is a great user interface. It has good graphic capabilities, and
Mplus
I don't know Mplus. Colleagues use it when there are issues with missing values, and the programmers are said to be the best statisticians in the world. So it must be good, but I don't use it.
SAS
This is old software. It is too complicated, and while it can do a lot through obscure options, it is not flexible enough to do what you want.
SPSS
This is bad software. It is a scandal that some universities still teach this.
Some R resources
Apparently the single best manual for R: https://r4ds.had.co.nz.- http://www.burns-stat.com/ - een man met een missie
- http://www.burns-stat.com/pages/Present/Excel_to_R_annotated.pdf - bewijst eigenlijk dat R graphics niet deugen
- http://www.burns-stat.com/pages/Tutor/R_relative_statpack.pdf
- http://www.burns-stat.com/pages/Tutor/spreadsheet_addiction.html
woensdag 7 juli 2010
This command in STATA
Niet alleen interessant voor switchers, maar ook leuk om trucs te weten te komen:
SPSS > STATA
http://www.ats.ucla.edu/stat/stata/faq/spss_command_to_stata.htm
SAS > STATA
http://faculty.fuqua.duke.edu/home/blanc004/data_programming/sas_to_stata/sas_to_stata.html
SPSS > STATA
http://www.ats.ucla.edu/stat/stata/faq/spss_command_to_stata.htm
SAS > STATA
http://faculty.fuqua.duke.edu/home/blanc004/data_programming/sas_to_stata/sas_to_stata.html
dinsdag 15 juni 2010
Estout
Stata is rampzalig om gebruiksklare output te leveren. Wie toch wil sukkelen, of bij gebrek aan beter, kan de Estout add on installeren:
findit estout
Je moet een stuk naar beneden om de installatiefile met een rare code te vinden.
Maar dan loopt het wel lekker, informatie bij de vleet:
findit estout
Je moet een stuk naar beneden om de installatiefile met een rare code te vinden.
Maar dan loopt het wel lekker, informatie bij de vleet:
- http://repec.org/bocode/e/estout/hlp_eststo.html
- http://repec.org/bocode/e/estout/hlp_estpost.html
- http://www.ats.ucla.edu/stat/stata/faq/estout.htm
esttab
de collectie est-ado's is uitgebreid, maar in de praktijk zijn we eigenlijk niet geïnteresseerd om Stata te gebruiken voor de opmaak van tabellen. Het is immers een ergerlijk programma op dat vlak: nu eens gaat het niet, dan weer wel ... Wat je eigenlijk wil zijn de meest simpele, onopgemaakte tabellen waar men bij de redactie nog alles mee kan aanvangen. Daarom gebruik ik:
esttab, plain wide
dankzij plain zien we geen irritante kadertjes, en dankzij wide staan de t-waarden nààst i.p.v. onder de bèta's. Waar de vrijheidsgraden of p-waarden gebleven zijn, weet ik niet, jammer genoeg. Doorgaans is t ~ z door een hoge n, en heb je die vrijheidsgraden niet nodig om de significantie te benaderen, maar we zitter er natuurlijk altijd liever klop op.
Voorbeeld
eststo clear
sysuse auto
eststo: quietly regress price weight mpg
eststo: quietly regress price weight mpg foreign
esttab, plain wide
... simpel (let op quietly)
Nog een nieuwtje: Stata 11.1 heeft nu ook estimation formatting. Mooi zo!
Links
http://gettinggeneticsdone.blogspot.com/2009/06/make-pretty-regression-tables-in-stata.html
Voorbeeld
eststo clear
sysuse auto
eststo: quietly regress price weight mpg
eststo: quietly regress price weight mpg foreign
esttab, plain wide
... simpel (let op quietly)
Nog een nieuwtje: Stata 11.1 heeft nu ook estimation formatting. Mooi zo!
Links
http://gettinggeneticsdone.blogspot.com/2009/06/make-pretty-regression-tables-in-stata.html
Carolina Population Center
Stata heeft de beste documentatie, maar niettemin moet die de volledigheid laten voorgaan op een user-centered approach. Surf daarom naar:
http://www.cpc.unc.edu/research/tools/data_analysis/statatutorial
... een héél didactische collectie tips voor Stata.
Ik apprecieer:
http://www.cpc.unc.edu/research/tools/data_analysis/statatutorial
... een héél didactische collectie tips voor Stata.
Ik apprecieer:
Abonneren op:
Posts (Atom)