Saturday, January 15, 2011

Stats paper: George P. Box: "Science and Statistics." 1976

The following are my notes and outline corresponding to a paper by George Box on the role of statistics in science.

Science and Statistics
Author(s): George E. P. Box
Source: Journal of the American Statistical Association, Vol. 71, No. 356 (Dec., 1976), pp. 791-799
Published by: American Statistical Association Stable
URL: http://www.jstor.org/stable/2286841.

Notes on Box: Science and Statistics


1 Introduction


Fisher was not just a great statistician, but a great scientist.

2 Aspects of Scientific Method


2.1 Iteration Between Theory and Practice

Learning is achieved by an iteration between theory and practice. Facts lead to the formation of a theory. The theory is used to predict outcomes. Discrepancy between prediction and experimentally known facts lead to a modified theory. The process repeats.

2.2 Flexibility

The iteration between theory and practice produces an “error signal,” the difference between what the theory predicts and what is known to be true. This is the feedback loop, and it what produces learning. Do not fall in love with the model; seek out error signals.

2.3 Parsimony

Seek to create simple models. Over-elaboration can be the mark of mediocrity.

2.4 Worrying Selectively

"Since all models are wrong the scientist must be alert to what is importantly wrong. It is inappropriate to be concerned about mice when there are tigers abroad."

2.5 Role of Mathematics in Science

"[We] cannot know that any statistical technique we develop is useful unless we use it. Major advances in science and in the science of statistics in particular, usually occur, therefore, as the result of the theory-practice iteration." The statistician must practice in the field and set himself up to be directly involved in real-life theory-practice iterations.

3 Fisher--A Scientist


This part explains how Fisher is a scientist, using for illustration his accomplishments at Rothamsted Experimental Station.

3.1 Rothamsted

At age 29 in 1919, Fisher took a temporary job at a small agricultural research station at Rothamsted. The director quickly saw that Fisher was a genius, and created a permanent post for him.

3.2 Weighing the Baby

Although he made astounding theoretical discoveries, Fisher had great interest in practical matters. In the textbook he wrote, Fisher used data he acquired by carefully weighing his own children to motivate a discussion of how best to plot data.

3.3 Find the Lady

In discussing the design of experiments, he uses another real-world example: At a scientific gathering, a lady declares that tea tastes different depending on whether the milk is poured into hot tea, or whether hot tea is poured into milk. On the spot, Fisher designs and executes an experiment to determine whether she can really taste the difference. It is said that this is a true story, and that the lady got nearly every test right.

3.4 From Soil Bacteria to Nonlinear Design

Many scientists visited Fisher for tea, and he became involved in their varied scientific pursuits, “often with dramatic consequences.” One such incidence of interest in another scientist's work lead to Fisher's pioneering work in nonlinear design.

3.5 From Cotton to Extreme Values

Another visitor to Rothamsted was concerned with cotton strength, which is limited by its weakest link. Work on this problem lead to a theory which has many different applications, and is considered its own field of study.

The rest of this section deals with work that Fisher did at Rothamsted and published in five volumes called “Studies in Crop Variation.”

3.6 From Dung to Orthogonal Polynomials and Residual Analysis

In “Studies in Crop Variation I” Fisher discusses the effect of different kinds of manure on crop yields. “In particular, he concludes that there is really nothing like plain dung.” Next, Fisher goes into the mathematical background which lead to his conclusions, wherein he introduces orthogonal polynomials and what we know call the analysis of variance or ANOVA. Box points out his discussion of residuals y-y(hat) as most interesting of all.

Box summarizes:
In the inferential stage, the analyst acts as a sponsor for the model. Conditional on the assumption of its truth he selects the best statistical procedures for analysis of the data. Having completed the analysis, however, he must switch his role from sponsor to critic.3 Conditional now on the contrary assumption that the model may be seriously faulty in one or more suspected or unsuspected ways he applies appropriate diagnostic checks, involving various kinds of residual analysis. (794)
Fisher then demonstrates mathematically that in order to maintain a small variance, one should use polynomials of smaller degree, an example of the value of parsimony. He also notes that extreme terms of the polynomial are greatly affected, which he calls “a weakness of the polynomial form” (794).

3.7 Weeds and the Education Acts

In the period of 1870--1880, wheat yields in all 13 fields were low, and not because of weather. These fields were weeded by young boys from a nearby school. Fisher implies an explanation of this low yield: "The Education Acts of 1876 and 1880 made attendance at school compulsory," (794) thus leaving the 13 fields choked with weeds and reducing yields. Note, however, that this wouldn't explain the low yields in the years prior to the first Education Act of 1876.

3.8 From Rainfall and Wheat Yield to Distributed Lags

In attempting to quantify the effect of rainfall on the 13 Broadbalk plots, Fisher was faced with too many regression factors (sunshine, soil nitrates, manure, weeding, etc) to produce a meaningful result. To get around this, he undertook a series of heavy calculations which we now call "distributed lag." Box points out Fisher's love of "parsimony" and notes that it may have been necessitated by Fisher's doing all this work by hand.

3.9 From Fertilizer and Potatoes to the Analysis of Variance

Fisher asks in “Studies in Crop Variation” whether there is an interaction between plant variety and fertilizer? Fisher does an analysis of variance (ANOVA). This may be Fisher's introduction of ANOVA. Fisher does the analysis of the plots incorrectly, but it gets corrected in the first edition of Statistical Methods.

3.10 Mice, Tigers, and Randomization

There's no mention of mice or tigers here, but it probably has to do with the earlier quote along the lines of “why bother with mice when there tigers about?” Box discusses (Fisher's?) table of a t-tests and Mann-Whitney tests on the same set of two samples of n=10 from a population of 1,000. The t-test is based on distributions and parameters, and the Mann-Whitney test is non-parametric. The point:

As is to be expected the significance level of the t-test is affected remarkably little by the drastic changes made in the marginal parent distribution-changes for which the distribution-free test provides insurance. Unfortunately, of course, both tests are equally impaired by error dependence unless randomization is introduced when they do about equally well. The point is, of course, that it is the act of randomization that is of major importance here not the introduction of the distribution-free test function.

The mice and tigers title suggests that one should worry about randomization (the tiger), not the type of test (the mouse).

3.11 From Muck Racking to Group Theory

Fisher had to apply special techniques to deal with a badly designed crop experiment. His friend William Gosset (of Student's t-test) suggested that he give them a hand in designing the next experiment, which Fisher did. Box uses this to illustrate the process of gathering existing data and using to create a preliminary experiment, then using data from that experiment to design a more statistically significant experiment to be carried out. This points out the shifting role of the statistician into a designer of experiments.

3.12 Evolution of the New Methods

Fisher came up with at least three tenets of good experimental design: “The need for randomization to achieve validity; for replication to provide a valid estimate of error; for blocking extraneous sources of disturbance to achieve accuracy.” This small section goes on to discuss something about blocking and Latin square. Box concludes: “However, while the efficiency of factorial designs could be increased by packing in more factors, larger factorial designs required bigger blocks and hence produced greater in-homogeneity in the experimental material, giving larger experimental errors. The answer which quickly followed was confounding.”

3.13 Persuading Practitioners

By 1924, Fisher had finally convinced those at Rothamsted to implement his ideas about how to improve experiment design. By 1929, “data were being collected from designs of great accuracy and beauty which included all of Fisher's ideas.” However, in 1926 the director of Rothamsted, Sir John Russell, published a paper about agricultural experimentation which ignored nearly all of Fisher's ideas about experiment design. Fisher responded by publishing a paper in the next issue of the same journal outlining his own ideas.

3.14 A New Heritage for Statisticians

Rothamsted hired Fisher to see if anything more could be learned from years of existing data. But Fisher redesigned his role to begin not after experiments were run, but before they were designed. The statistician's “responsibility to the scientific team was that of the architect with the crucial job of ensuring that the investigational structure of a brand new experiment was sound and economical” (797).

4 Perils of the Open Loop


Extraordinary progress can be made when theory turns to practice, and practice returns to theory. One must not remain for too long in either the realm of theory or the realm of practice.

4.1 Cookbookery and Mathematistry

“Cookbookery” is to fall into using routines, or recipies, by rote, without giving too much thought to their implementation or interpretation or analysis. The other end of the spectrum is “mathematistry,” when a mathematician takes practical ideas to too far into theory, losing practical relevance and scientific usefulness. Fisher was highly critical of mathematistry. Mathematistry may be harmless, except that it wastes the talents of those who might otherwise contribute to actual scientific progress. Or it may be harmful: Those who do not understand statistics may be overawed by mathematistry and may take its concepts too seriously, to the detriment of their experiments. A final danger of mathematistry is that too many statisticians will aspire to teach instead of practice. There should not be successive generations of statisticians without practical knowledge.

4.2 Meeting the Challenge

There will be an increasing need for competent statisticians.

4.3 Training of Statisticians

“A proper balance of theory and practice is needed and, most important, statisticians must learn how to be good scientists; a talent which has to be acquired by experience and example.” Fisher warns sternly against directing the most talented statisticians towards theory and away from practice.

5 Conclusion

Box concludes:

We may ask of Fisher: Was he an applied statistician? Was he a mathematical statistician? Was he a data analyst? Was he a designer of investigations?

It is surely because he was all of these that he was much more than the sum of the parts. He provides an example we can seek to follow.

Sunday, December 12, 2010

Rails 2.3.8: Upgrading to Bundler

On the way to upgrading an application to Rails 3, I want to try replacing Rails' current gem management system with Bundler. I'll do this by following the Rails 2.3 instructions on the Bundler site.

As always, begin by creating a new branch and switching into it:
$ git branch bundler
$ git checkout bundler

Now we can begin installing Bundler.
First, insert the following code into /config/boot.rb, right above the last line (Rails.boot!):

class Rails::Boot
  def run
    load_initializer

    Rails::Initializer.class_eval do
      def load_gems
        @bundler_loaded ||= Bundler.require :default, Rails.env
      end
    end

    Rails::Initializer.run(:set_load_path)
  end
end

Next, create a new file, config/preinitializer.rb, and insert the following:

begin
    require "rubygems"
      require "bundler"
rescue LoadError
    raise "Could not load the bundler gem. Install it with `gem install bundler`."
end

if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
    raise RuntimeError, "Your bundler version is too old for Rails 2.3." +
         "Run `gem install bundler` to upgrade."
end

begin
    # Set up load paths for all bundled gems
      ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
        Bundler.setup
rescue Bundler::GemNotFound
    raise RuntimeError, "Bundler couldn't find some gems." +
          "Did you run `bundle install`?"
end

Then, create the file /Gemfile and copy the following code into it:
source :gemcutter
gem "rails", "~> 2.3.5"
gem "sqlite3-ruby", :require => "sqlite3"

# bundler requires these gems in all environments
# gem "nokogiri", "1.4.2"
# gem "geokit"

group :development do
  # bundler requires these gems in development
  # gem "rails-footnotes"
end

group :test do
  # bundler requires these gems while running tests
  # gem "rspec"
  # gem "faker"
end

I needed to add the gems which are specific to my application, including factory_girl. Furthermore, I use MySQL instead of SQLite, so I'll have to change those lines too. Ultimately, my new Gemfile looksl ike this:

source 'http://rubygems.org'
gem "rails", '2.3.8'
gem 'factory_girl'
gem 'searchlogic'

# bundler requires these gems in all environments
# gem "nokogiri", "1.4.2"
# gem "geokit"

group :development do
  # bundler requires these gems in development
  # gem "rails-footnotes"
end

group :test do
  # bundler requires these gems while running tests
  # gem "rspec"
  # gem "faker"
end


At this point int he Bundler instructions, it ends with "From this point on, you can follow the instructions in the Rails 3 guide" and then the command
$ rake db:migrate

I'm not sure why this is here, as it comes with no explanation. I don't think any migrations have been generated, so I'm not sure why we are supposed to run a migration. Nevertheless, I do it anyway:
$ rake db:migrate

As predicted, nothing happens. Clicking on the link "Learn more: Rails 3" takes us to the Rails 3 installation tutorial, where we are meant to continue following the steps.

At this point, to see if it's working, run bundler from the command line:
$ bundle install

To my astonishment, it works. To test it out, let's add Devise to the Gemfile and see if Bundler can install them:
gem "devise", "1.0.9"

Then from the command line:
$ sudo bundle install

Again, it works. Thanks Rails.

The next step would be to clean up the old code that's no longer needed for gem management. All I can think of is to remove the gem lines from /config/environment.rb by commenting them out:

#RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION
#  config.gem "factory_girl"
#  config.gem "searchlogic"

After restarting the server, everything still works, so I guess it's a successful install of Bundler. Having that out of the way will make the transition to Rails just a little bit easier.

To finish up, we need to commit our changes, merge back into the master branch, and delete the bundler branch:
$ git add .
$ git commit -am "upgraded to Bundler"
$ git checkout master
$ git merge bundler
$ git branch -d bundler

Done.

Saturday, December 11, 2010

Setup vs. Set up

The word "setup" comes up a lot in software blogs. Many writers misuse it. Two common cases arise:

Noun

Setup (one word)
"When you've finished the setup script, continue by...."
"The setup process is relatively simple...."

Verb

Set up (two words)
"This is a walkthrough with all steps you need to set up a resource..."
"If you're having trouble setting up the system...."
"This should allow you to set up the...."
"Then the user can set up his own...."
"One can set up a new product by...."

If you're a blogger, distinguish yourself by using the proper case.

Monday, December 6, 2010

the R Project for Statistical Computing

R (r-project.org) is a free (and open source) language and software environment for statistical computing and graphics. If you need to perform statistical analysis or create visualizations of data sets, check out R. It works on most operating systems; ask Google for any one of the many fine installation tutorials.

The biggest barrier to entry to using R comes from its lack of a graphical user interface (GUI). Instead of seeing and manipulating data and selecting commands from a menu as in Microsoft Excel, users of R type in functions at the command line. It looks just like the DOS prompt that so few people use now. Does this mean you have to be a programmer to use it? No, but when you start using it, you'll be creating mini computer programs without realizing it. The rest of this article contains information about a few things I found useful when learning R.

R Commander

require(Rcmdr)
R Commander is the closest thing that users have to a GUI. It is probably the best way to start learning how to use R, because as a user selects commands to run from the menu, she can see the result entered into the command line. However, one should quickly move toward manipulating R using the command line directly; it will become immediately evident how much more powerful the command line really is.
R Commander. Image source: John Fox
To start using R Commander, use it to play around with some of the sample data that comes with a standard installation of R. See below.

Included data sets

data()
R comes with many sample data sets pre-loaded. IPSUR (see below) uses many of these small data sets to illustrate concepts. To see a list of all the example data sets included by default with R, simply type in data() at the command prompt. To see a sample data set, simply type in its name. For example, type in cars to see the data about speed and stopping distance of cars. Playing with these data sets using R Commander is a great way to start learning R syntax. For example, try the command hist(cars$speed) to see R generate a histogram of data from the "speed" column of the data set called "cars."

Introduction to Probability and Statistics Using R

To get started with R, I'd recommend the freely available textbook Introduction to Probability and Statistics Using R (IPSUR [PDF]). Like so many other great internet resources, it's free and open source. The author, G. Jay Kerns of Youngstown State University, has compiled the whole book in LaTeX (also open source), producing a publication-quality textbook based specifically on using the R language and environment. This book makes use of the many example data sets included in R. It includes installation instructions and walks the reader through the mathematics of statistics while using R to perform the calculations.

I did not use IPSUR to learn statistics; I only used it to apply what I already knew about statistics to the R environment. As such, I can't comment on it as a statistics book, but only as an R book. It may be that the typical user should start with a introductory statistics book to learn the vocabulary and motivation for statistics, and then move to IPSUR and R with that foundation in place.

The lattice package

library(lattice)
I found the lattice package to be particularly useful in creating quality graphics. Make it available to R by typing library(lattice) at the command line. With the lattice package loaded, you have more graphical functions available. For example, instead of hist(), you also histogram(). Try histogram(cars$speed) and compare it to the default hist(cars$speed).

Data sets with two variables can be displayed easily using a simple XY chart, or the Cartesian plane familiar from high school algebra. The relationship is visualized by plotting each variable along one of the two axes. Lattice gets most of its power from its ability to meaningfully display data sets with more than two variables.

For example, look at the "environmental" data set (loaded along with the lattice package) by typing in the command head(environmental). Notice that it has four variables: Ozone, radiation, temperature, and wind. (You could see this more directly with command names(environmental).) To visualize the relationship of all possible pairs of these variables together, use the command splom(~environmental, data=environmental).

Some useful commands:

  • ?lattice Open the help file for the command "lattice"; replace "lattice" with any R command to see its help file.
  • head(cars) View the column headings and the first five rows of the data set "cars"; replace "cars" with any data set to see a truncated listing, which will avoid printing out possibly thousands of lines of data in the command window. Useful for seeing what a particular data set looks like.
  • neuse$month_integer <- with(neuse, as.POSIXlt(neuse$DATE)$mon)
  • boxplot(Log_SURFCHLA~SOURCE + month_integer, data=neuse)
  • splom(~ cbind(Murder, Assault, Rape), data = USArrests)
  • histogram(~Log_SURFCHLA|month_integer, data = neuse)

Other statistics packages

R isn't the only option. Below are some other software packages that have robust statistical computational capacity. Unfortunately, all are closed-source and proprietary.
  • Minitab ($1,395; Minitab 16)
  • Stata ($1,245; Stata IC)
  • SAS ($8,100; SAS Analytics Pro)
  • Excel ($139.99; Excel 2010)

Sunday, December 5, 2010

Reactions to Rob Bell's Velvet Elvis

Velvet Elvis, by Rob Bell

Velvet Elvis made me realize for the first time that as a congregant, I can not only affect and change my church, but that I am actually connected to the first-generation Christians from the book of Acts.
And so these first Christians passed on the faith to the next generation who passed it on to the next generation who passed it on to the next generation until it got to ... us. Here. Today. Those who follow Jesus belong to his church. And now it is our turn. It is out turn to step up and take responsibility for who the church is going to be for a new generation. It is our turn to redefine and reshape and dream it all up again. (p. 164)
I copied this down when I read it because it beautifully put into words what I had been feeling and realizing: that I am an adult now, I am a member of First Pres Berkeley, I serve on a committee, people listen to me, I introduce myself to new people, I have lots of friends there, I know the staff, it is my church, I am part of it, and therefore I can change it and affect it.

Basically, I realized that I must both connect the church I attend with the crazy stuff that the apostles were doing in Acts (planting churches, getting arrested, writing letters, founding Christianity), and realize that I am part of it and I can change it. It was founded in 30 AD or whatever, and what we're part of now is the same thing, and we have the same power to change it that the founders had. If I want it to be a certain way, then I can push it in that direction.

The church is nothing but a group of people with common beliefs who come together to worship, serve, love, question, struggle, give, take, communicate, sing, play, eat, reach out, listen, and pray. I am one of those people, and I do all of those things, so how I do them is part of what defines my church. My church is, literally, whatever I make it.

Image source: amazon.com

The second important point that the book drove home for me was the concept of unconditional service as evangelism. From page 167:
And this is because the most powerful things happen when the church surrenders its desire to convert people and convince them to join. It is when the church gives itself away in radical acts of service and compassion, expecting nothing in return, that the way of Jesus is most vividly put on display. To do this, the church most stop thinking of everybody primarily in categories of in or out, saved or not, believer or nonbeliever. Besides the fact that these terms are offensive to the "un" and "non," they work against Jesus's teachings about how we are to treat each other. Jesus commanded us to love our neighbor, and our neighbor can be anybody. We are all created in the image of God, and we are all sacred, valuable creations of God. Everybody matters. To treat people differently based on who believes what is to fail to respect the image of God in everyone. As the book of James says, "God shows no favoritism." So we don't either.

Oftentimes the Christian community has sent the message that we love people and build relationships in order to convert them to the Christian faith. So there is an agenda. And when there is an agenda, it isn't really love, is it? It's something else. We have to rediscover love, period. Love that loves because it is what Jesus teaches us to do. We have to surrender our agendas. Because some people aren't going to become Christians like us no matter how hard we push. They just aren't. And at some point we have to commit them to God, trusting that God loves them more than we ever could. (p. 167)
To me, Rob Bell's point--as well as the point of a large chunk of the New Testament--is that we should just love everyone, all the time, unconditionally. Yes it's impossible. Yes it's inspiring.

15 Reasons Why I Love Open Source

Open source software is free in two senses of the word: It is free as in beer, and free as in speech. The "source" part of open source refers to the actual lines of computer code that to compile to form the final software package. "Open" means that anyone can download that code, look at it, change it, use it, re-compile it, improve it, learn from it, adapt it, and integrate it his or her own projects.

  1. The community. Open source communities comprise friendly, helpful, enthusiastic, passionate, generous people. They appear on list-serves, discussion groups, IRC channels, blogs, forums, and other arenas to discuss nearly every open source project or topic you can think of.
  2. The teamwork. On large projects, community members typically contribute only small bits of code at a time, sometimes only one line. Some users don't contribute code at all, but focus on graphics or documentation.
  3. The licenses. MIT license, GNU license, Mozilla license, and others. People have put a lot of thought into making these licenses fair, solid, and protective of open source ideals. Most open source software projects apply one of these licenses, which assure the users that the software will always be free and open source.
  4. The cost. With an open source license attached, the software is free, always, with no exceptions, ever.
  5. The quality. It's constantly improving, and it has spawned some of the greatest software available. In the realm of web development, nearly all of the best packages are community-driven and open source, such as the Apache web server (which serves 59% of all web pages), the Linux OS, the WordPress platform, and Wikipedia (the underlying software, not the content).
  6. The evolution. The software industry changes rapidly, and the nothing beats the open source community at riding, pushing, adapting to, benefiting from, and gaining from that change. For example in the Ruby on Rails community, a popular authentication module called restful_authentication discontinued development as the Rails core itself moved on to more sophisticated technology; as a result, along came Devise, a better, faster, cleaner, and more elegant solution. The community evolved.
  7. The add-ons. Ruby and Ruby on Rails has Gems. R has packages. Firefox has add-ons. The modularity bult into these popular programs allows the community to easily contribute functionality, and it allows user to easily adopt that new functionality.
  8. The software. The software itself is great. I use Ubuntu Linux, Open Office, Ruby on Rails, R, Firefox, and others. Open source software virtually can't be bad--otherwise users would flee and development would cease and the project would die.
  9. The updates. I love getting updates. I love downloading the newest versions and reading about all the improvements that volunteers have made. I love it when I get a slick new version of Ubuntu every six months. In the private software world, programs sometimes stagnate. Microsoft released Internet Explorer 6 in 2001, then essentially ceased developing it for years until Firefox (open source) took over a huge piece of its market.
  10. The security. Linux, the open source operating system that can replace Windows, has no viruses that I know of. Ruby on Rails provides security fixes so fast they once tripped over their own feet and broke their own code base.
  11. The distribution. Open source projects sometimes have hundreds or thousands of contributors. The wide distribution of volunteers means that popular projects will virtually never stall.
  12. The transparency. An open source project will typically provide plenty of information about what developments are currently underway, where the project is headed, and when to expect updates and new releases.
  13. The competition. Open source projects compete with each other for users, and they compete with private industry groups for users. This healthy competition forces both sides to continue producing good software, and on the private side, it helps drive costs down for proprietary software. In many cases, it has lead to private companies releasing their software for free (while keeping their code "closed-source"). Free software: Skype, Internet Explorer, Adobe Reader. Without open-source equivalents, these companies might have no reason not to charge for this software.
  14. The equivalents. For many proprietary software packages, the open source community has created free equivalents. Microsoft Office has Open Office; Adobe Photoshop has GIMP; Microsft Windows and Apple OsX have Linux. See Open Source as Alternative (osalt.com) for a complete list.
  15. The names. The open source community gives creative, apt, and frequently humorous names to its creations. For example, Cinerella is a movie movie studio package, and Pidgin is an instant messenger platform that "speaks" to many different services.
Look around your computer at the programs you use the most, and consider trying out an open source alternative. Beginners: Start by replacing Internet Explorer with Firefox. More advanced users: Download Open Office instead of paying hundreds of dollars for the next release of Microsoft Offce (NB: MS Office has legitimately better features, but only power users can tell the difference). Advanced: Download Ubuntu and try a whole new operating system.

Thursday, December 2, 2010

What is LaTeX?

LaTeX (pronounced "lay-tech") is for typesetting documents. Microsoft Word is also for typesetting documents, but there are a few major differences between Word and LaTeX. The biggest difference is that Word provides a what-you-see-is-what-you-get (WYSIWYG) editor as a graphical user interface (GUI). LaTeX by itself does not a WYSIWYG editor or any sort of GUI. Instead, LaTeX requires the user to edit raw, unformatted, plain text, much as if he were writing HTML. In that way, creating a LaTeX document is like creating an HTML web page.

To create an HTML page (hypertext markup language), you type in the content you want in your document, then you "mark up" the content using HTML tags such as headings, paragraphs, lists, tables, and links. The HTML file itself a plain-text file with a ".html" file extension, such as "example.html". The HTML page is associated with a CSS file (cascading style sheets) which applies visual styles to the marked up text. Then a web browser like Internet Explorer or Firefox renders the document in the browser window. To summarize, the HTML file holds the marked-up content, the CSS file controls how the marked-up content looks, and the browser renders the final product.

LaTeX works much the same way. But instead of using HTML tags to mark up the content, one uses LaTeX tags to mark up the content. And instead of using a ".html" extension, a LaTeX file has a ".tex" extension, such as "example.tex". And instead of a CSS file to define the visual style, the LaTeX program itself defines the visual style. And instead of rendering the final product in a browser, LaTeX typically renders the final product as a PDF file.

If that seems restrictive, that's because it is. With no CSS file to define the visual layout of the document, the new user has little control over how the rendered document looks. But therein lies the power of LaTeX: Behind the scenes, LaTeX has thousands of rules and algorithms for determining the best way to visually present the content. A Stanford University math professor created the foundation for LaTeX in the 1970s, and with 40 years of development behind it, LaTeX does a very good job of deciding how to render your content. Users of LaTeX argue convincingly that authors should worry about content and let document designers worry about layout.

LaTeX is best used for creating text documents--essentially anything you would create in Microsoft Word is a fair candidate for LaTeX. For the beginning user, it is not the best choice for creating graphics or flow charts or slide presentations.

To get started using LaTeX (it's free), use the excellent installation instructions in the "Get LaTeX" page at www.latex-project.org.