In a scientific experiment, the independent variable is the variable you manipulate--the one over which you have some degree of control (some people call these explanatory variables). For example, suppose you want to know whether caffeine causes headaches. You'd get a bunch of people, divide them into groups, and give each group a different dose of caffeine; then, some time later, you'd ask them how much their head hurts. In this case, caffeine is the independent variable, and headache is the dependent variable.

More complicated experiments can involve multiple independent variables and multiple combinations thereof. Let's say you want to do the reverse of the above study--you want to compare two drugs that alleviate headache. You'd get three groups and give each group a different dose of Drug 1; then you'd get another three groups and give each one a different dose of Drug 2. Then you could see which drug has the best effect at a particular dose, which drug has the best effect overall, and so on. You could also give another set of people both drugs, which would allow you to see if the combination had an additive effect or no effect at all. Studies like these get complicated and expensive: if you have two drugs and three possible doses per drug, you need six groups of subjects; if you want to test all possible combinations as well, you need another nine groups.

Typically, you also want to include a control group in which subjects do not receive the independent variable at all (so now you have a sixteenth group in the second study). In the headache study, you'd want one group that didn't receive any drugs at all (or more properly a placebo). Here's why: suppose 5 of your control subjects reported that their headaches went away. Now suppose 5 of your subjects on the lowest dose of Drug 1 get better. Well, that's the same number as in the control condition, so as far as you can tell, giving the low dose of Drug 1 is no better than giving no drug at all; you would have to conclude that the low dose of Drug 1 had no detectable effect.

Also, in studies like these, you usually want to use a double-blind design and a placebo control so that the placebo effect doesn't give you misleading results.