Okay. What you see here is something we have already covered at the end of last lecture.
The second case of sampling that I discussed, namely the case in which the sample is drawn
from a normal distribution, but the variance of the distribution is unknown. And of course,
the mean is also known. The mean is the parameter which we would like to estimate.
And we had the first case where we simplified things by saying, well,
we don't know the mean, but we do know the variance. That was not a very realistic case,
but it had the advantage that then the distribution of the estimator is normal.
Here in the second case where we are realistically assuming that the variance of the normal
distribution is also unknown. So the only thing we do know is that it is a normal distribution,
but we neither know the value of its mean nor the value of its variance. In this case,
the distribution of the estimator is not normal, as I have shown to you, because we have to
estimate the unknown variance or standard deviation, which we do by this estimate here.
That's the standard estimate, which is unbiased because we divide by the number of degrees of
freedom rather than by the number of observations. And then we derive a statistic such as this one
here written here as a random variable, yn bar. So the sample average minus the true mean of the
population, the random variable divided by the standard deviation of the sample mean is distributed
as a statistic with a t distribution with n minus 1 degrees of freedom. And I had shown to you,
I think this was the last slide of last lecture, that the t distribution, which is also sometimes
called student's t distribution, that this t distribution approaches a normal distribution
as the numbers of degrees of freedom increases. Actually, this convergence is rather fast.
You see a t already for 20 observations, that is to say 19 degrees of freedom, that the t distribution
and the normal distribution, both of them here depicted by their probability density function,
are already very, very close. So it doesn't require a great number of observations to assume
that the normal distribution is a good approximation to the distribution of this t statistic, which
we have here. Now, until now, I have always indicated by a subscript n the amount of
observations that we had. So for instance, yn bar would tell us that we use n observations to
compute the sample mean or n observations to compute the standard deviation of the sample.
I will now simply write y bar, small y bar, s and s, without this subscript. And you please
just keep in mind that obviously these sample statistics always involve the sample observations
and thereby they always involve a number of observations n, which we will not make explicit
in notation to keep the notation as simple as possible. Continence intervals is the next thing
that we need to talk about when we have a statistic, which is following a t distribution.
We had this already for the normal distribution. So what we do here is very close to what we've
already done. It's completely analogous. When we want to construct a confidence interval for
the probability level of say 1 minus alpha, and you may think of alpha being 5%, then we need to
find the critical value, which I here denote C with index alpha divided by 2, C for critical value
from the t distribution. And the t distribution is tabulated in almost any statistical textbook.
For instance, you also find it in Woolridge, in appendix G, table G2, and then you have to
find the critical values C for alpha over 2, because we have a two-sided test question
here. So we would like to know what is the critical value, the appropriate critical value,
such that the probability of minus C being less than t being less than plus C is exactly equal to
1 minus alpha. So the probability of error, the probability of null hypothesis
being rejected is this alpha here, and then we have just half of this probability
for each critical value on each side of the distribution.
So if we set it up this way, then a 1 minus alpha confidence interval for the true value of the
sample mean, so for mu y, is obtained by constructing this type of interval here,
where we take the sample mean minus the critical value times the sample standard deviation,
S over the square root of n, and y bar plus the same quantity named critical value times
the sample standard deviation. And the critical value always leaves half of the alpha as the
residual probability for the null hypothesis to be true. We write this shorthand as y bar plus
minus critical value times standard error of y bar, and you note that S e for standard error of y bar
is of course just the sample standard deviation divided by the square root of n,
which I had shown you last time. Graphically, this is perhaps easier to understand than when
you just look at the formula. So if we have a t distribution here, that's a t distribution which
looks already quite close to a normal distribution by the way. If we have this pdf here, then what
we would like to know is which values negative c and c are such that t statistics lower than
negative c or t statistics greater than plus c are actually having a joint probability of 5%.
So that the shaded area of this distribution here plus the shaded area of this distribution here
adds up to 5%. And obviously, what is lies in between is the 95%. This of course,
implies that we have 2.5% probability of a more extreme value of a lower value than negative c
and 2.5% of a greater value than plus c. So that the two of them add up to 5%.
Now, let me give you a real world example. Suppose that we study the effect of an investment tax
credit. So companies have to pay less taxes if they do certain types of investment,
which are eligible for this type of subsidy for this tax credit. So suppose we have a sample of
20 firms which received this type of investment tax credit in 2010. And there was no investment
tax credit granted in 2009. So that this is a new measure aimed at encouraging companies to invest.
Now, let us assume that we have data on the investment carried out by the firms in 2009
and 2010 so that we can compute the change in investment. And we will actually look at the
change in log investment because, for instance, by initial analysis, we found that the distribution,
the probability density function, the empirical histogram of investment changes was not symmetric,
was probably skewed to the right. So we take the log of that and then we have a distribution which
is approximately normal. So let's assume the true distribution of the change in log investment
is actually a normal distribution. Now, I have not given you the data. Actually, this example is not
one of the Woolridge examples, which you find in this textbook where all the data are supplied.
Not really necessary that we do know all the data. I just give you one single number,
which is important. The sample average of the log investments is 0.02. Excuse me. The sample
average of the changes in log investment is 0.02. Now, you know that a change in log investment is
approximately equal to the growth rate, to the percentage change. So this would say investment
has grown from 2009 to 2010 by about 2%. And the question now is, is this a significant
increase in investment? Do then probably to the investment tax credit with these 20 firms.
But in order to answer that question, which is obviously a relevant question because 0.02 is
quite close to 0, right? So it could be that it is not significant. In order to answer this
question, what we have to do is that we construct a confidence interval for the true mean of the
distribution of the changes in log investments. We just have the sample mean here, but we want
to have a confidence interval for the true mean. And let's say we want to have a 95% confidence
interval for the mean change in log investment for this mu here. Well, then the appropriate
confidence interval is given by the sample average y bar. So these 0.02 plus or minus
the critical value for the 2.5% tail of the t distribution times the standard error of y bar.
The standard error of y bar, as we know, is the standard error of the sample
divided by the square root of n. Now, suppose the standard error we can compute is 0.009.
Then we see that the confidence interval, the 95% confidence interval, is 2.093 times 0.09.
This would be 0.019. And if we add this to the 0.02 here, then we get a confidence interval
of 0.001 and 0.039. So taking the sample mean y bar, 0.02, and then subtract 2.093 times 0.009
from this value or add this product from this value. The question is, what do we conclude from
this confidence interval? We are not in interactive mode, and it's not worth going to interactive mode
for the simple question. But if anybody perhaps would like to type in the answer to this question
quickly in chat or Q&A, what can we conclude from the confidence interval being 0.001 and 0.039?
Any ideas? Any replies?
Somebody raises his hand. Yes, that's nice. But please type in your, there it comes, apparently,
your answer. The answer is with a question mark not significant. It's good you put a question mark
behind it, because that's not true, right? Quite the contrary. It's true, apparently. Sorry.
On the wrong slide. Here we are again. Apparently, this 0.02 is significant,
because you see that the value of 0 is not included in the confidence interval. So we know
that we are quite far off in terms of standard errors from 0. And this we can take as evidence
for the fact that the true sample mean mu is actually different from 0. So that we,
actually, we can say a little bit more. We cannot only say that the true sample mean is probably
different from 0. But we can say that the true sample mean is positive with a certain likelihood.
If we speak loosely, I told you that it's not quite exactly quite accurate to say this confidence
interval tells us that mu is positive with a probability of 95 percent. But rather than when
drawing 100 confidence intervals, then we will know that 95 percent of them will indicate that
the 0 is not included. But leaving these times of finer, these sorts of finer questions
formulation issues aside, basically, the message is that the statistic here is significantly
different from 0, because 0 is not included in this confidence.
Assuming that this is now clear to you, I come to case three, where we don't even assume that we
have a normal distribution from which our sample is drawn. So the system by which I structured
these three cases was that we know less and less about the distribution of the sample,
less and less about the true population. In case one, I assumed that we know it is a normal
distribution, and we know the variance of normal distribution is 1, and then we constructed the
confidence interval. In case two, we still assumed it is a normal distribution, but we did not know
what the variance of the normal distribution is. Of course, in both cases, we didn't know what the
mean of the distribution was. And now in case three, we don't even assume that we have a normal
distribution anymore. We just don't know anything about the distribution. We don't know what kind
of distribution it is. We don't know what the mean is. We don't know what the variance of the
distribution is or any higher moments for that matter. Still, we can have valid inference,
provided that we have sufficiently many observations, because then we can resort to
our asymptotic arguments. That is to say, we can resort to the central limit theorem.
Now case three is actually a very relevant case, because in many, many applications,
the populations we deal with does not have a normal distribution, or at least we don't know
whether the distribution is normal or not. So that's not a problem if the sample size
is large enough for the central limit theorem to give us a good approximation
of the distribution of the sample average y bar. So provided that we have a large sample,
so that n is large, we have an approximate confidence interval equal to the sample mean
y bar plus or minus 1.96 standard errors of y bar. So it's exactly the same thing as it was
in case one actually for the normal distribution, just that now we can do this kind of inference
only if we can argue that n is sufficiently large. And how large n has to be in order to be
sufficiently large actually depends on what type of distribution is the underlying distribution.
We have seen that if for instance the underlying distribution were a t distribution,
student's t distribution, then already a sample size of 20 would be sufficiently large to say
that normal distribution is quite a good approximation to the true distribution.
But if there are other types of distributions underlying, for instance a log normal distribution
which is not symmetric, then we typically need more observations to invoke the central limit
theorem and rightly say that the asymptotic distribution of the sample mean is normal even
though the underlying distribution is not normal. Now note this 1.96 is the 97.5 percentile of the
standard normal distribution. So again like in the previous case of the t distribution we leave
2.5 percentage points of probability for the null hypothesis being true in the tails of the
distribution when we apply a critical value of 1.96. Obviously 1.96 is approximately 2
and in empirical research people aren't really often don't really bother to write down the 1.96
but rather they use 2. So the rule of thumb is actually that the confidence interval for
sufficiently large samples can be constructed as the sample mean plus or minus two standard errors.
of the y bar. So that's the easiest way to get a feeling of how big confidence interval is and
whether an estimate is significantly different from zero or not. Of course this feeling here
applies for the case of a two-sided test. Two-sided tests are actually most common in econometrics
but there are also instances in which we will apply just one-sided tests and then 1.96 is not
the 5 percent critical value anymore but it's the 2.5 percent critical value for the whole test
since we just test in one direction. The standard error of y bar is as I have already pointed out
the standard error of the sample. So the standard deviation of the sample divided by square root of n.
So the standard error shrinks to zero as the sample size increases and this means that the
confidence interval becomes smaller with increasing n and actually the confidence interval will shrink
will contract to a single point asymptotically. So asymptotically we know exactly what the
parameter is we are looking for provided of course we have infinitely many observations
but then we can estimate arbitrarily precise the underlying parameter of the distribution
not only at 5 percent level of significance so at a 95 percent confidence interval but also
at confidence intervals which have a much higher probability than 95 percent. So 99 percent,
99.9 percent, 99.9999. These type of confidence intervals are sometimes or hopefully often
applied in the biosciences for instance when it comes to testing the effects of new medicine
and new pharmaceuticals because there of course you need to know that for instance no harm is
caused by a new pharmaceutical which you want to put on the market so 5 percent likelihood of
the pharmaceutical behaving in a way in which it is not intended to behave is of course not
acceptable in these areas whereas we as economists can cope with confidence intervals which are only
95 percent rather than higher.
Any questions as far as confidence intervals are concerned?
Don't see anything so let me come to hypothesis testing which is of course closely related to
confidence intervals. What I would like to explain first is how you should proceed
when you test a certain hypothesis because there are a number of steps which you should be aware
of when you interpret test statistics which come out of your computer's software since computer
software gives results so easily sometimes or occurs and perhaps even often occurs that
students don't even really think about what exactly is the null hypothesis what exactly
is the type of test is it one side is it two sides but they just look at some statistic like
a t-statistic or p-value or something like this and then they conclude something without
knowing exactly what do they actually infer because they haven't made clear what the
alternatives the hypotheses are and what the alternative is. So here comes an exposition of
how to design a test. The first thing you have to do when testing a specific hypothesis then you
have to make clear to yourself what is the hypothesis you would like to test so what kind
of hypothesis you would like the data to give you inference on how would you like to confront
the hypothesis with the information contained in the data that's the null hypothesis.
The null hypothesis is always the hypothesis which you think is true and you would sometimes
hope that the data contradict a null hypothesis so you know this is probably not true. So H0 is the
null hypothesis the hypothesis to be tested then you need to have an alternative hypothesis so you
need to know in case the null hypothesis is rejected what then what is to be accepted if
the null hypothesis seems to be not true that is the alternative hypothesis and this is typically
denoted H1. Then we need to choose a test statistic before actually carrying out a test so we need to
have some function of the random sample this is all what a test statistic is some function of
the random sample so you take the sample you have drawn and use the numbers in the sample and in
some way you combine these numbers and compute a certain magnitude and that is the test statistic
there's not more about that and this a test statistic is a function of the values you have
in your sample or of the random variables which constitute your sample. Next before carrying out
the test you need to choose the significance level of the test so you have to make clear to
yourself do you want to test at five percent level or at one percent level or perhaps at the level of
even lower than one percent depending on what degree of certainty you aim for and given the
significance level of the test which you must choose you then have to determine the corresponding
critical value the critical value always critically depends on the significance level so
you need to fix the significance level before choosing the critical value from some appropriate
distribution. This critical value is always determined under the assumption that the null
hypothesis is true if the null hypothesis were not true then the critical value is not
well defined because the distribution typically depends on a parameter and under the null
hypothesis we specify what size this parameter is very often we specify that the parameter is zero
and then we can under this assumption compute the distribution of our sample under this hypothesis
so the distribution depends on the parameter and if we say have an alternative value let's say
parameter is not equal to zero but it is equal to one then the distribution is different distribution
since the alternative hypothesis often does not specify a specific value for the parameter of
interest so it does not say mu is one or mu is one half or mu is 0.345 but rather says
mu is not zero we cannot really compute a distribution in most cases at least we cannot
compute a distribution under the alternative hypothesis since we have not specified
precise value of the parameter under the alternative distribution we just have this
another null hypothesis and therefore the distribution is always always computed under
the null hypothesis and the test statistic t is evaluated assuming that h zero is true
the rejection rule then is that we have under certain circumstances to reject the null hypothesis
so the rejection rule determines when to reject h zero in favor of h1
based typically on comparing a value of the test statistic to the critical value
so the test statistic t is itself a random variable but we would have if we applied to
real world data in our sample we would have a real number small t which we have to compare to
the critical value c which was derived from the distribution and then we reject h not a null
hypothesis if t is greater than c an absolute value so that's the rejection rule and the
rejection region well these are the values of the test statistic that reside in rejection of
the null hypothesis for given critical values so let's look at the first case here and the mean in
the normal population and let us suppose that we want to test null hypothesis against a two-sided
alternative h1 so our null hypothesis is that the mean in the normally distributed population is
equal to mu naught versus the alternative is mu is different from mu naught what would we have to do
we would have to compute a test statistic t is the square root of n times y bar minus
mu naught so minus the expected value of y bar provided that the null hypothesis is true
provided that the true mean of the population is equal to mu zero if this is true then we subtract
mu zero from y bar and divide by a sample standard deviation which of course the sample
standard deviation comes into this formula just because actually what we want to divide through
is the standard error of y bar and the standard of error of y bar as you know is s divided by
square root of n so that's the t statistic the rejection rule for a two-sided test now with a
significance level of alpha would be that the absolute value of the t statistic is greater
than the critical value for alpha over two so for two-sided test we have to divide the probability
which we test against or at which level of significance we test we have to divide this
by two the intuition for this type of test is then that h zero is rejected if the sample mean
y bar is far from the true value or the hypothesized i should say the hypothesized true
value in absolute value so if this difference here is great then we would say it's not very
plausible that mu not is actually the mean of the population because our sample means completely
different and what does mean that y bar is far from mu not here where far we can only measure
in terms of standard error units and this is why we divide by the standard error of y bar
if the difference here is less than one standard error then we would typically say well this is not
far if it is less much less still than two standard errors we would say well that can still
happen but if this difference here is much greater than two standard errors of y bar then we would
typically say well it's not really likely that mu not is the sample mean and therefore we reject
the hypothesis that the sample mean mu is equal to mu not so the intuition of a test is very easy
and almost all tests are constructed that way we reject the null hypothesis if the sample mean
y bar is far from the hypothesized value mu not in absolute value
okay here's the same thing graphically we have the hypothesis in this case the null hypothesis
that the mean is zero and the alternative hypothesis is that mu is different from
this mu not which would in this case just be zero so again under the pdf of this random variable
we would have 95 percent of probability in this white area here and we would have 2.5 percent of
probability here and there so the rejection region is simply the region to the left of negative c
and to the right of plus c here
now there are two mistakes which we can make in hypothesis testing one mistake would be that the
null hypothesis is actually true but the test statistic is somewhere in the rejection region
and then we reject the null hypothesis although it is true that's the first type of error
that we can make the second type of error that we can make is that the null hypothesis is actually
wrong but the test statistic is somewhere here in the acceptance region of the distribution
um that can easily happen for instance if the true value of the mean is close to zero
let's say the true value of the mean is here and then we would expect that the test statistics
would be distributed around this value here so it would lie somewhere here and all of that would
be in the acceptance region of our current test so we would accept the null hypothesis that the
mean is actually zero even though the null hypothesis is not true that's the second type
of error that we can make they're just called type one error and type two error so type one
error says reject the null hypothesis although it is true let's say it's but type one error means
that we reject the null hypothesis even though it is true and the type two error is the converse
that we fail to reject the null hypothesis although it is false
now it is interesting to know what the likelihood of these two types of errors is
and for the first type error so for type one errors that's very easy the probability of a
type one error is the significance level of the test is alpha because we know the probability
that we reject the null hypothesis even if it is true is just the probability in these blue
segments here right and under the null hypothesis we know this likelihood of having test statistics
which are in this area or in that area this likelihood is five percent right so alpha the
significance level of the test is the probability of a type one error the probability of a type two
error is denoted by beta and it cannot be directly computed because it depends on the true value of
the parameter which we don't know so while here we knew in the type one error that the
null hypothesis was true so we knew that the true parameter is zero same but in a type two error we
don't do not know what the true parameter is we just know it is not zero because the null hypothesis
is false so it is not the parameter hypothesized under the null hypothesis the null hypothesis
can also hypothesize different value or for mu need not be zero but whatever the null hypothesis
has hypothesized that is false and any other value can be correct so the true value can lie
here or it can lie there or it can lie there or way out here that we don't know but of course
the probability of a type two error depends on where the true parameter lies and therefore we can
we can introduce a symbol for it and say well this probability is beta but we can not say how
big beta is we can just say that beta is what we call the power no sorry beta contributes to what
we call the power of the test because the power of the test is one minus beta that is the power
of a test is the greater the smaller beta is the smaller the probability of a type two
errors well in general the greater this alpha here is the smaller is beta and vice versa
right that's simple to see but it doesn't really help us much because we don't really know what the
beta is now let us suppose that we have a one-sided alternative so that the alternative is either
that mu is greater than mu naught or that mu is less than mu naught as i already said such
one-sided tests are less common in applied econometrics than two-sided tests but the principle
of the test is exactly the same we reject the null hypothesis hypothesis when the value of the sample
average is either sufficiently smaller than mu naught or sufficiently greater than mu naught
and we compute the test statistic just as before so there's no difference it's just that the
rejection region is now chosen differently it does not refer to c of alpha half but it refers to c
at the level alpha or minus c negative c at the level alpha so the rejection rule is either t is
greater than c alpha or t is less than negative c alpha case two would be the asymptotic tests for
non-normal populations well then again we would use the central limit theorem if n is sufficiently
large so we would compare the test statistic t with the critical values from a standard normal
distribution because we know that under H naught we have that the distribution of the random variable
capital t so of the random variable which gives rise to our concrete values of the test statistic
this distribution is for sufficiently large n y bar minus mu naught and if we divide this by the
sample standard deviation then this random variable by the central limit theorem is divided
as a standard normal so n with expected value of zero and standard deviation equal to one
now essentially it would suffice for us to have the t statistic
then we can look up the critical values and see whether the t statistic is greater or smaller
than the critical value and what this tells us about test but often people prefer to work with
p values the p value of a test is now it's getting a little complicated perhaps you really
have to digest this wording the p value of a test is the largest significance level and which we
could still carry out the test and fail to reject the null hypothesis right i'll give you an example
below in a few seconds but think again about the definition of the p value the p value of some test
is the largest significance level and which we could still carry out the test and fail
to reject the null so that the statistic would not yet be just marginally not yet be significant
as an example consider the problem of testing a null hypothesis mu is equal to zero
in a population which is distributed normally with mu and sigma square
assume moreover that n is large enough for t to have a standard normal distribution
under the null hypothesis so the test statistic is square root of n times sample mean divided by
the standard deviation assume that n is sufficiently large so that we know the distribution
of this thing here is approximately standard normal if the null hypothesis is true
now let's assume that the value for t the specific realization for small t is 1.52
the largest significance level at which we would fail to reject the null hypothesis
is this significance level which is associated with using t as the critical value right so if t
is just the critical value then we can just not yet reject the null hypothesis
because the t statistic has not exceeded its critical value but is exactly equal to it
on the other hand it is clear that this is the largest significance level that we
may have otherwise we would exceed the critical value
well this largest significance level at which we would fail to reject h not can therefore be
computed as small p is defined as the probability of t being greater than 1.52 given that the null
hypothesis is true well you know from our theory of distribution functions that the probability
of t being greater than 1.52 is equal to 1 minus the probability of t being less than 1.52
and the probability of t being 1.52 for the normal distribution is given by phi of 1.52
and so we can convert this thing here as the probability of an event which occurs and where
then it's asked where the some statistic is greater than some other statistic thus we can
easily convert into an event where something needs to be smaller than that in this case 1 minus phi
of 1.52 and well this we can evaluate using a table of the normal distribution and it turns
out that is 6.5 percent so the p value is 6.5 percent this means that there is still 6.5
probability for h not for from u being equal to zero
this would be the test with a 6.5 significance level usually you would not choose 6.5 percent
as a significance level but the econometric software would compute for you what the significance
level is that would be maximal given the observation we have made and the software
then turns this out as p value it is identical information actually as compared to the
estimation on the t statistic now we have a probability of 6.5 percent which means that
if we have fixed our significance level at 5 we fail to reject the null hypothesis but if we have
initially fixed our significance level at 10 and reject when then we reject the null hypothesis
what is really important for good empirical work is that you always fix the significance level
before looking at the results so what you should never and really never do is that you first
calculate the p statistic 6.5 percent and then you decide that you would like to apply a 10
level of significance and say oh that's good this is your significance right that's not good
science you should always apply your significance level before you actually carry out the test
so do not change the significance level in view of the results this is not serious statistics
so note that the p value has another interpretation because we can say that it is the probability to
observe a large value of t equal to 1.52 when the null hypothesis is true right the p value is the
probability to observe a value for random variable capital t as large as small t equal to 1.52
under the hypothesis that the null is true
now is 6.5 percent as in this example small enough to reject the null hypothesis
well this depends on our tolerance of type 1 errors if we say that we reject H not already
for instance because we apply a 10 percent significance level then this means we must
have a tolerance of 10 percent for rejecting the null when the null is in fact true so we would
reject the null rather often but there is no other way to handle this problem but rather give
the researcher the freedom to decide what kind of significance level he finds appropriate
and then as i said this should not be changed after seeing the data
generally small p values are evidence against H zero as they indicate that the outcome of the
data occurs with small probability if H naught is true so here it is again what you have to do
when working with p values choose a significance level alpha choose test statistic capital t and
decide on the nature of the alternative so whether you want to have a two-sided or a one-sided test
and this then determines whether the rejection rule is either t is greater than c alpha in the
case of a one-sided test or t is smaller than t alpha this should be alpha over two um oh no sorry
now that's not correct um t smaller than minus c alpha in the case of the other side being tested
so there's still a one-sided test or here for the two-sided test t bar being greater than absolute
value then c over alpha divided by two then compute the p value of the statistic t and reject
the null hypothesis if the p value p is smaller than alpha otherwise if it is greater or equal
than alpha um accept the null hypothesis from this discussion should be clear that there are
actually three different ways of um hypothesis testing or i should rather say three equivalent
ways of hypothesis testing we may test a null hypothesis by comparing the value of the test
statistic with the appropriate critical value so we would reject the null hypothesis if t exceeds
the critical value c we may equally well reject the null hypothesis if the p value p is smaller
than alpha than the significance level or we may reject uh the null hypothesis if mu not the
hypothesized value for the parameter we are interested in is outside the confidence interval
for significance level alpha the third approach is typically only used when we have two-sided test
um confidence intervals are rarely um constructed as one-sided intervals
now what i would like to ask you now is um sort of the first step towards own research
and i call it your own research question actually i think um i mean this idea is from thomas
ziedler or from some other person thomas ziedler has used to include this in his uh
slides i think it's a brilliant idea and i don't want to credit it to me so give all the credit to
to thomas ziedler on that the idea is that on my next slide i uh give you a catalog of possible
research questions and now what i would like you to do is now that you choose one of those research
questions just as a thought experiment so during the course of the lecture you always think that
you are a researcher who is dealing with this particular research question which you will pick
from my list uh now when i show you uh this list and during the course of the lecture i will always
come back to this particular research question or better i will then say well i go back to your
specific research question and i hope most of you have picked different research questions
and then i will ask you that just in your mind you think about how you would apply the methods
that i have taught you in this lecture to your particular research setting to the particular
question you would like uh to address or you you imagine to address during the course of the
lecture you won't have any uh data available to research this question so don't bother about the
availability of uh of data just think theoretically on how you would design your research if you were
uh to research the particular problem that you choose uh from my list and i will give you then
in the course of the lecture questions which you should answer with respect to your particular
research question and of course you can discuss with your fellow students how they solve their
research question and what kind of answers they came up with but it is quite possible that for
different research questions you may have different um solutions to the answers that
i would give you to to the questions that i would give you so here is the list of research uh
questions question number one could be what is the effect of minimum wage on unemployment so
introducing minimum wage legislation in a country like germany has done it only rather recently
what is the effect of this on unemployment of course usually assuming that everything else
stays constant question number two does access to electricity say in developing countries improve
health of those people who have electricity question number three doesn't pay off for
companies to advertise on facebook question number three do tuition fees at universities
reduce the number of students question number five i think it is now does course attendance improve
your grade in a course next question does increasing alcohol taxes reduce binge drinking
next question does playing a music instrument increase cognitive skills in particular if you
learn this music instrument early in your life does pay for performance on a job increase stress
levels of workers and thereby perhaps have a negative impact on workers health
do students jobs decrease the performance of students at university
does increasing the generosity of paid sick leave and focus contracts improve the health
of employees because they go to a doctor earlier and perhaps are less vulnerable to diseases if
they see a doctor earlier does retirement make people happy does unemployment make people sick
not necessarily you i don't know why i wrote you here so brothers say does unemployment make people
sick does graduation with honors improve the wage that you will earn later in your life
does an internship increase the chance of finding a job immediately after graduation
so this is a catalog of questions and feel free to add further questions to this catalog and
think of a particular question you may be interested in but do me the favor and pick
one of those questions now or at least at the latest until next week and remember during the
course of the lecture so that whenever i come back to the section your research question in
my slides that you know what your research question was so when you have chosen one of those
questions as your research question and you keep it in your mind for the rest of the lecture at least
then you can start doing the first step of such exercises of mental exercises already with the
following questions for your research question think about what is actually the population of
interest so the population from which you would like to draw your sample for your particular
specific research question think about how would you draw a sample from this population very
practically how would you how would you come to the data that you need to research your question
then state and null hypothesis and an alternative for well an interesting hypothesis you would like
to analyze you would like to research for from your research question think about what would a
type one error look like in your particular case given hypothesis that you have picked here
and what would be a type two error i think it's very useful to go through these questions really
apply to a specific research question assuming that you can then collect data and do the tests
as i said don't bother about the about the availability of data
okay and that was all for the second set of slides you may notice that i did not have the
research questions yet in the set of slides that was uploaded to steener i have changed a little
bit the slides here you find these slides as i have just presented them on steener now i have
just uploaded them a couple of minutes before i started the lecture so if you want to see the
research questions again just go to steener and download the new set of slides are there any
questions regarding the content i have presented so far in the lecture raise your hand wave to me
please there are questions
that is not really a question that is more an answer and then
the statement that the answer is not as the student wanted to give the answer so i think
nothing for me to answer if there is nothing else you would like to ask me and i don't see anything
i would close um slides number two and move to the review of basic economic
that goes all right
let me move this a little bit so that i can go to where it starts which is right here
okay chapter three of this lecture review of basic econometrics that's a rather long review
actually i will go through basically everything which i think you should have learned already
in undergraduate studies to get you more or less on the same level it may well be that i
for some of you that i cover material which you have not yet had in your undergraduate studies
so in that case it would not be a review but it would be new material it may also be that
the way i present things here are new to you because often in econometrics
professors don't yet make use of matrix algebra but as you probably know it is
standard to use matrix algebra in scientific on the scientific level of econometrics it actually
makes things much easier if you denote your model in terms of matrices rather than in terms of
single numbers and equations so what i will do here is that i will present the basic econometrics
that you probably have learned in the undergraduate studies in terms of matrix algebra i will
introduce you to the the most important rules of matrix algebra by the way and you'll also do this
in the accompanying lecture on your disking but that may be new to you even if you know the basic
econometrics already and at least get acquainted with that because you will need this in other
lectures and you will need it in the sequel of this lecture even though i try to keep the level
of matrix algebra low in sections four to ten of this lecture it will come up every once in a while
that i use matrix notation that said let me introduce the readings which are also referring
to a new textbook which i haven't referred to so far so no angers in pishka in this case but
william green is a very good textbook on econometric analysis not too simple not too
difficult i would say what i cover here in the review of basic econometrics corresponds
approximately to chapters two to six of the green textbook or you may go to a consult
jeffrey woodridge's introductory econometrics to which i have also already referred more to the
appendices of these this textbook by the way now i refer to chapters two to six also that's a
coincidence i would say that it's chapters two to six in both textbooks it's not a misprint not some
kind type of copy and paste error that i made it is indeed the case that is chapters two to six
in both textbooks and chapters two to six well these are five chapters that's quite a bit and
this is all in this set of slide which i think is some 170 slides so we'll deal with it for
several lectures actually good we start out very easy not yet in matrix notation just with the
problem of a variant regression much the way you have learned it in undergraduate econometrics
everybody of you has learned it that way i suppose so let us suppose that we want to explain
certain observations y which we have by certain observations x which we have a hypothesis
hypothesizing that y is approximately equal to f of x so it's approximately a function of
the variables x i write approximately here because there are always errors which i have not yet
introduced in the notation but in terms of the observations that we make we say that there is
some function f which relates observations x to observations y so that this is approximately equal
now we make just the first simplifying assumption on on that we say that f is a linear function
um for instance y i is equal to a constant b1 plus a constant b2 times observation x i so i
denotes the observation i runs from one to capital n and then i say e i is the error or the
approximation error so everything which is not captured by the linear relationship y i is equal
to b1 plus b2 x i any difference between y i and b1 plus b2 x i that would be the error and this
involves both the approximation error here as also some type of specification error because we have
perhaps not included certain relevant relevant variables or anything like this so e i is an
error and we ignore this error we we don't observe it right we don't know how big it is
we just have our observations y i and x i and actually we don't know what the b1 and b2
coefficients are either we want to estimate b1 and b2 from the data which we have which means
that we have n equations here so for each observation we have one equation which says
y i is b1 plus b2 x i plus e i and we would like to determine what b1 and b2 will be
such that the n observations are the the n equations which we have
well are as good as possible in the sense that the right hand side of the equation is as close
as possible to the left hand side of the equation obviously if we just had two observations
n were equal to two it would be very easy to compute b1 and b2 because then we would have
two equations and two unknowns and we can solve this since it's a linear system so there would
be no e i anymore we would just find coefficients of this type but typically and only then
econometrics makes sense we have more observations than we have parameters to estimate and then
these errors come into play because we cannot satisfy all the equations with the same set of
coefficients here let me give you an example for that the data actually for this example you find
on steener data from the pen world tables these are ppp adjusted data so ppp is purchasing power
parity so they are expressed in comparable units across countries 487 countries basically most
countries of the world let's say basically all countries and these are data on private consumption
and on gdp as i say they are real consumption data real gdp data because they are ppp
adjusted and they are expressed on a per capita basis so we can compare them across countries
right there will be some countries which are rich and other countries are which are poor
in terms of real per capita consumption for the year 2007 so what we have here is a cross section
of countries and we have no time dimension oops no time dimension we just have a single year 2007
you all have learned what a canesian type consumption function is in your
undergraduate macro classes where you would say that consumption depends on income and the question
is can we estimate such a canesian type world consumption function as an exercise you can take
my data which as i said are on steener and compute the correlation between private consumption and
gdp just to get a feeling of the data you should find that the result is the correlation between
private consumption and gdp is 0.923 let's verify that you get the same and here is the scatter plot
of the data here you see gdp in per capita units in real units so ppp adjusted gdp and here you see
what people consume out of the gdp they have what the average what the average citizen of one of the
187 countries consumes in year 2007 in ppp adjusted units out of ppp adjusted income that he has
available and it is not surprising of course that we see a strong correlation meaning countries
which are rich in per capita terms for instance these two here have high levels of consumption
and countries which are poor somewhere down here with low levels of gdp per capita typically many
countries in africa but also in asia and perhaps in latin america will be down here these countries
have low levels of consumption so there is this very clear positive correlation between private
consumption and gdp and we may now say well this here is a consumption function we would like to
estimate a consumption function out of these data which indicates to us what level of real per
capita consumption would obtain if we equip a representative agent with a certain income
in the year 2007 so we might even say this is approximately linear not quite apparently some
outliers are here and are there some are above and some are below the main set of data here
but more or less it seems to be the case that linear approximation is perhaps not the first
attempt we can take on this this day so let's assume that we want to fit a linear relationship
to the set of data that is we look for constant b1 and we look for slope coefficient b2 where gdp
is the independent variable how do we do this well you assume you all know the principle of least
squared as least squares estimation already but still i explained it here a good estimate
will make the approximation error e which we had small what we do is that we try to make the mean
squared error small small so we sum all the errors and we sum the squares of these errors actually
so ei is being squared so that in the sum positive negative errors do not cancel but
actually add up because we just had positive numbers here and then we take the average
squared error and we will try to make the estimate such that this mean squared error here is as
small as possible so we want to choose b1 and b2 in such a way that this mean squared error here
is as small as positive actually the factor 1 over n is completely unimportant because it
doesn't depend on b1 and b2 so since n is given we can equally minimize just the sum of the squared
errors so this is our minimization problem which we have minimize over appropriate choice of b1 and
b2 the sum of the squared errors and i denote the sum of the squared errors now as s
of b1 and b2 so functional arguments are b1 and b2 the sum of squared errors
depends on which values for b1 and b2 we pick because the ei's here the squared ei's
are the same as our observations yi minus b1 minus b2 xi squared
i'm just making use of equation what was it two i guess right equation two here right solve
equation two for ei you see ei is equal to yi minus b1 minus b2 xi substitute for ei in this
sum to get yi minus b1 minus b2 xi and then you square this because we have to square the error
so this sum here depends on the choice of b1 and b2 and now we have to minimize this sum by
appropriate choice of b1 and b2 for given data yi and xi that's a well-defined minimization problem
obviously the way to do this is that we take the derivatives so we take the partial derivative
of s with respect to b1 and on the next slide we take the partial derivative of s with respect to
b2 the partial derivative is of course well since we had a square here it's two times the squared
number which is yi minus b1 minus b2 xi and then we have to take the to apply the plane rule
take the derivative with respect to b1 while this derivative is just minus one because we
have a minus b1 here so this derivative we set equal to zero obviously the minus one doesn't
play any role here because we have zero on the other side so we can just divide by
minus one we can also divide by two so the first order condition is actually that the sum of the yi's
is equal to the sum of b1 plus b2 xi okay now what is this we can simplify this a little further
note this what is in english to the sign forgot not a question mark but exclamation sign i guess
it is called over the equality sign this says we want to pick p1 and b2 b1 and b2 such that
this equation holds it doesn't hold automatically for any choice of b1s and b2s obviously but we
want to pick b1 and b2 in such a way that the equality holds so it shall held that
sum over the yi's is equal to the sum over b1 plus b2 xi now we can simplify a little bit because
the sum over all those b1s is since b1 is constant just n times b1
plus then we have b2 times the sum over all the xi's so on the left hand side of the equation
we have the sum over all the yi's on the right hand side we have the sum over all the xi's
multiplied by b2 here we have n times b1 obviously the equation is easier to write
if we divide it by n which we can do on both sides of the equation then we have here the sample
mean of the y's y bar shall be equal to b1 plus b2 times the sample mean of the x's
and obviously here that means also that it shall be the case so i might have written
an exclamation sign here and there as well so we want to choose b1 and b2 such that this equation
holds this equation four equation four is one equation for two unknowns which we have
that is not yet enough to determine the two unknowns obviously but as you see here we have
just taken the partial derivative of s with respect to b1 so we can also take now the
partial derivative of s with respect to b2 to obtain second equation that's what we do here
partial of s with respect to b2 well this is again the sum over two times the expression which
had been squared now chain rule multiplied by minus xi and this shall be equal to zero
okay so what can we make out of that we can divide by two of the whole equation so the two
goes away we cannot divide by xi because the xi is different in each term of this
sample so we have to multiply out multiply the xi into this expression here gives us xi yi
and this is being summed multiply the xi here with the b1 gives us on the other side the sum over b1 xi
and here it gives us the sum over b gives us b2 times the sum over the xi squared
so we can write this in such a way that only positive magnitudes appear on both sides of
the equation we have the sum over the xi yi's here we have the b1 times the sum over the xi's here
we have b2 sum times the sum over the xi squared here and then of course we divide again the whole
equation by n so that we get the average over the xi yi's and the average over all the xi squared
multiplied by b2 and here we have b1 times the average x that is equation five it's a little
more complicated than equation four was but it is a second equation in b1 and b2 because these
quantities we can compute from the data we can compute the x bar we can compute the sum over the
squared x axis so that we now have two equations and two unknowns and that enables us to solve
for the unknowns b1 and b2 now note that here is a term which is related to the covariance
of the sample covariance the sample covariance of x and y of our observations x and y is actually
one over n times the sum over the xi yi's so precisely this term here minus the product of
the sample means x bar y by bar that is the sample the estimated sample covariance and
i denote it as covariance hat of x and y and similarly this term here is related to the sample
variance so one over n times the sum of the squared axis minus x bar squared is as you know
the sample variance and i denote it by variance hat of x
these would be the covariance and the variance computed without correction for degrees of freedom
so you may know that these are not the unbiased estimators but they are asymptotically unbiased
they are consistent right and i denote them in this way this will come up more or less often
in the lecture this this notation here so what can we do we can multiply our equation
four this was the first fourth order first order equation the first first order condition by x
square by x bar so doing that we would get x bar times y bar is equal to b1 x bar plus b2 x bar
squared that's my equation six and it comes directly from equation four here
multiply equation four by x bar right doing this we would have y bar x bar here b1 x bar here
b2 x bar squared here so that's this equation and now take equation six and subtract it from
equation five so from the second first order condition so subtract it from this equation here
then we have the sum over the xi's yi's divided by n minus x bar y bar so this would be the
covariance you see the result here right here we would have the sample covariance covariance of x
and y and here we would have oh wait a minute we would have b2 x2 bar bar squared subtracted
from the sum of the xi's squared multiplied by b2 divided by n so we would have this expression here
um this here minus this gives us b2 times the variance and then you see that the term b1 x bar
cancels because here we have negative b1 x bar when we subtract that so that the necessary
condition five can actually transform be transformed to the condition covariance hat of xy
shall be equal to b2 times variance hat of xy of x so the sample covariance
shall be equal to b2 times the sample variance of x and this is now a condition which has only one
unknown left namely only b2 so that's the necessary condition for b2 the condition b2 shall
satisfy so i could have wrote an exclamation mark here again so that we can very quickly conclude
b2 the slope coefficient for our regression is equal to the covariance of x and y divided by
the variance of x sample covariance and sample variance okay so the optimal choice for b1 and
b2 is just given by equation seven where we have so for b2 that's the least squares estimate
in this bivariate setting for b2 and b1 which then comes from our equation four because equation
four tells us that b1 is equal to y bar minus b2 x bar and this would be y bar minus the relationship
of sample covariance and sample variance times x bar so here we have our estimates these estimates
solve our minimization problem these estimates minimize the sum of the squared
error terms ei that i had in equation two okay the interpretation of that is that in a bivariate
regression the estimate b2 is similar to a correlation coefficient right the covariance
of x and y divided by the variance of x is quite similar to the coefficient which would be the
which would compute the correlation between x and y because for the correlation between x and y we
would just have the covariance of x and y in the numerator like here divided by the
standard deviation of x and the standard deviation of y here we do not divide by the standard
deviation of x and the standard deviation of y but rather we divide by the standard deviation
of x squared so by the variance of x so it's not exactly the coefficient of correlation but it is
similar to the coefficient of correlation in particular when the standard deviation of y
is similar to the standard deviation of bar of x, as is the case in our sample. So the estimate
B2 is similar but not equal to a correlation coefficient. And the estimate of B1 is the
average of the observations y, so is this y bar here, adjusted for the average of the
explanatory variables x, and adjusted with this sort of correlation coefficient.
Okay, I come to these estimates in the next lecture. At home, you may do the following two
exercises. How does B2 differ from, well, I explained already, sorry, so I solved this
exercise already for you. No need to do it anymore, unless you didn't understand it the way I explained
it and solved it. And exercise two, compute x bar, y bar, sample covariance of x and y
for the data set that I have uploaded to Stine. So when x is GDP and y is private
consumption data of our example. And then compute the estimates B1 and B2 manually from these numbers
here from these form numbers, which you shall compute, and only then compare with the results
on the next slide. So see whether you can actually manually derive the least squares estimates for
this simple bivariate regression using the formula that I gave you and using the data that I have
uploaded to Stine, and then see whether you get the same results that I will present to you on
the next slide. That's it for today in the webinar part. We are already almost through with
time still. I would like to ask you to come to the meeting session now. So I will stop the recording
here and we'll stop the webinar meeting and go to the interactive.