### 经济代写|计量经济学作业代写Econometrics代考|Conditional Expectation and Projection

statistics-lab™ 为您的留学生涯保驾护航 在代写计量经济学Econometrics方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写计量经济学Econometrics代写方面经验极为丰富，各种代写计量经济学Econometrics相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 经济代写|计量经济学作业代写Econometrics代考|The Distribution of Wages

Suppose that we are interested in wage rates in the United States. Since wage rates vary across workers, we cannot describe wage rates by a single number. Instead, we can describe wages using a probability distribution. Formally, we view the wage of an individual worker as a random variable wage with the probability distribution
$$F(u)=\mathbb{P}[w a g e \leq u]$$
When we say that a person’s wage is random we mean that we do not know their wage before it is measured, and we treat observed wage rates as realizations from the distribution $F$. Treating unobserved wages as random variables and observed wages as realizations is a powerful mathematical abstraction which allows us to use the tools of mathematical probability.

A useful thought experiment is to imagine dialing a telephone number selected at random, and then asking the person who responds tn tell ws their wage rate. (Assıme for simplicity that all workers have. equal access to telephones, and that the person who answers your call will respond honestly.) In this thought experiment, the wage of the person you have called is a single draw from the distribution $F$ of wages in the population. By making many such phone calls we can learn the distribution $F$ of the entire population.
When a distribution function $F$ is differentiable we define the probability density function
$$f(u)=\frac{d}{d u} F(u) .$$
The density contains the same information as the distribution function, but the density is typically easier to visually interpret.

In Figure $2.1$ we display estimates ${ }^{1}$ of the probability distribution function (panel (a)) and density function (panel (b)) of U.S. wage rates in 2009 . We see that the density is peaked around $\$ 15$, and most of the probability mass appears to lie between$\$10$ and $\$ 40$. These are ranges for typical wage rates in the U.S. population. Important measures of central tendency are the median and the mean. The median$m$of a continuous${ }^{2}$distribution$F$is the unique solution to $$F(m)=\frac{1}{2}$$ The median U.S. wage is$\$19.23$. The median is a robust ${ }^{3}$ measure of central tendency, but it is tricky to use for many calculations as it is not a linear operator.
The expectation or mean of a random variable $y$ with discrete support is
$$\mu=\mathbb{E}[y]=\sum_{j=1}^{\infty} \tau_{j} \mathbb{P}\left[y=\tau_{j}\right]$$
For a continuous random variable with density $f(y)$ the expectation is
$$\mu=\mathbb{E}[y]=\int_{-\infty}^{\infty} y f(y) d y .$$
Here we have used the common and convenient convention of using the single character $y$ to denote a random variable, rather than the more cumbersome label wage. We sometimes use the notation Ey instead of $E[y]$ when the variable whose expectation is being taken is clear from the context. There is no distinction in meaning. An alternative notation which includes both discrete and continuous random variables as special cases is
$$\mu=\mathbb{E}[y]=\int_{-\infty}^{\infty} y d F(y)$$

## 经济代写|计量经济学作业代写Econometrics代考|Conditional Expectation

We saw in Figure ?? the density of log wages. Is this distribution the same for all workers, or does the wage distribution vary across subpopulations? To answer this question, we can compare wage distributions for different groups – for example, men and women. The plot on the left in Figure $2.2$ displays the densities of log wages for U.S. men and women. We can see that the two wage densities take similar shapes but the density for men is somewhat shifted to the right.

The values $3.05$ and $2.81$ are the mean log wages in the subpopulations of men and women workers. They are called the conditional means (or conditional expectations) of log wages given gender. We can write their specific values as
$$\begin{gathered} \mathbb{E}[\log (\text { wage }) \mid \text { gender }=\text { man }]=3.05 \ \mathbb{E}[\log (\text { wage }) \mid \text { gender }=\text { woman }]=2.81 . \end{gathered}$$
We call these means conditional as they are conditioning on a fixed value of the variable gender. While you might not think of a person’s gender as a random variable, it is random from the viewpoint of econometric analysis. If you randomly select an individual, the gender of the individual is unknown and thus random. (In the population of U.S. workers, the probability that a worker is a woman happens to be 43\%.) In observational data, it is most appropriate to view all measurements as random variables, and the means of subpopulatlons are then conditlonal means.

As the two densities in Figure $2.2$ appear similar, a hasty inference might be that there is not a meaningful difference between the wage distributions of men and women. Before jumping to this conclusion let us examine the differences in the distributions more carefully. As we mentioned above, the primary difference between the two densities appears to be their means. This difference equals
\begin{aligned} \mathbb{E}[\log (\text { wage }) \mid \text { gender }=\text { man }]-\mathbb{E}[\log (\text { wage }) \mid \text { gender }=\text { woman }] &=3.05-2.81 \ &=0.24 . \end{aligned}
A difference in expected log wages of $0.24$ is often interpreted as an average $24 \%$ difference between the wages of men and women, which is quite substantial. (For a more complete explanation see Section 2.4.)
Consider further splitting the men and women subpopulations by race, dividing the population into whites, blacks, and other races. We display the log wage density functions of four of these groups on the right in Figure 2.2. Again we see that the primary difference between the four density functions is their central tendency.

Focusing on the means of these distributions, Table $2.1$ reports the mean log wage for each of the six sub-populations.
Table 2.1: Mean Log Wages by Gender and Race
\begin{tabular}{lcc}
\hline \hline & men & women \
\cline { 2 – 3 } white & $3.07$ & $2.82$ \
black & $2.86$ & $2.73$ \
other & $3.03$ & $2.86$ \
\hline
\end{tabular}
The entries in Table $2.1$ are the conditional means of $\log ($ wage $)$ given gender and race. For example
$$\mathbb{E}[\log (\text { wage }) \mid \text { gender }=\text { man, race }=\text { white }]=3.07$$
and
$$\mathbb{E}[\log (\text { wage }) \mid \text { gender }=\text { woman }, \text { race }=\text { black }]=2.73$$

## 经济代写|计量经济学作业代写Econometrics代考|Log Differences

A useful approximation for the natural logarithm for small $x$ is
$$\log (1+x) \approx x$$
This can be derived from the infinite series expansion of $\log (1+x)$ :
\begin{aligned} \log (1+x) &=x-\frac{x^{2}}{2}+\frac{x^{3}}{3}-\frac{x^{4}}{4}+\cdots \ &=x+O\left(x^{2}\right) \end{aligned}
The symbol $O\left(x^{2}\right)$ means that the remainder is bounded by $A x^{2}$ as $x \rightarrow 0$ for some $A<\infty$. Numerically, the approximation $\log (1+x) \simeq x$ is within $0.001$ for $|x| \leq 0.1$. The approximation error increases with $|x|$.
If $y^{}$ is $c \%$ greater than $y$ then $$y^{}=(1+c / 100) y$$
Taking natural logarithms,
$$\log y^{}=\log y+\log (1+c / 100)$$ or $$\log y^{}-\log y=\log (1+c / 100) \approx \frac{c}{100}$$
where the approximation is (2.2). This shows that 100 multiplied by the difference in logarithms is approximately the percentage difference between $y$ and $y^{*}$. Numerically, the approximation error is less than $0.1$ percentage points for $|c| \leq 10$.
Many econometric equations take the semi-log form
\begin{aligned} &\mathbb{E}[\log (w) \mid \operatorname{group}=1]=a_{1} \ &\mathbb{E}[\log (w) \mid \operatorname{group}=2]=a_{2} \end{aligned}
How should we interpret the difference $\Delta=a_{1}-a_{2}$ ? In the previous section we stated that this difference is often interpreted as the average percentage difference. This is not quite right, but is not quite wrong either.

As mentioned earlier, the geometric mean of a random variable $w$ is $\theta=\exp (\mathbb{E}[\log (w)])$. Thus $\theta_{1}=\exp \left(a_{1}\right)$ and $\theta_{2}=\exp \left(a_{2}\right)$ are the conditional geometric means for group 1 and group 2 . The geometric mean is a measure of central tendency, different from the arithmetic mean, and often closer to the median. The difference $\Delta=\mu_{1}-\mu_{2}$ is the difference in the logarithms between the two geometric

means. Thus by the above discussion about log differences $\Delta$ approximately equals the percentage difference between the conditional geometric means $\theta_{1}$ and $\theta_{2}$. The approximation is good for percentage differences less than $10 \%$ and the approximation deteriorates for percentages above that.

To compare different measures of percentage difference in our example see Table 2.2. In the first two columns we report average wages for men and women in the CPS population using three “averages”: mean (arithmetic), median, and geometric mean. For both groups the mean is higher than the median and geometric mean, and the latter two are similar to one another. This is a common feature of skewed distributions such as the wage distribution. The next two columns report the percentage differences between the first two columns. There are two ways of computing a percentage difference depending on which is the baseline. The third column reports the percentage difference taking the average woman’s wage as the baseline, so for example the first entry of $34 \%$ states that the mean wage for men is $34 \%$ higher than the mean wage for women. The fourth column reports the percentage difference taking the average men’s wage as the baseline. For example the first entry of $-25 \%$ states that the mean wage for women is $25 \%$ less than the mean wage for men.

Table $2.2$ shows that when examining average wages the difference between women’s and men’s wages is $25-34 \%$ depending on the baseline. If we examine the median wage the difference is $20-26 \%$. If we examine the geometric mean we find a difference of $21-26 \%$. The percentage difference in mean wages is considerably different from the other two measures as they measure different features of the distribution.

Returning to the log difference in equation (2.1), we found that the difference in the mean logarithm between men and women is $0.24$, and we stated that this is often interpreted as implying a $24 \%$ average percentage difference. More accurately it should be described as the approximate percentage difference in the geometric mean. Indeed, we see that that the actual percentage difference in the geometric mean is $21-26 \%$, depending on the baseline, which is quite similar to the difference in the mean logarithm.
What this implies in practice is that when we transform our data by taking logarithms (as is common in economics) and then compare means (including regression coefficients) we are computing approximate percentage differences in the average as measured by the geometric mean.

## 经济代写|计量经济学作业代写Econometrics代考|The Distribution of Wages

F(在)=磷[在一种G和≤在]

F(在)=dd在F(在).

μ=和[是]=∑j=1∞τj磷[是=τj]

μ=和[是]=∫−∞∞是F(是)d是.

μ=和[是]=∫−∞∞是dF(是)

## 经济代写|计量经济学作业代写Econometrics代考|Conditional Expectation

\begin{tabular}{lcc} \hline \hline & men & women \ \cline { 2 – 3 } white & $3.07$ & $2.82$ \ black & $2.86$ & $2.73$ \ other & $3.03$ & $2.86$ \ \hline \end{表格}\begin{tabular}{lcc} \hline \hline & men & women \ \cline { 2 – 3 } white & $3.07$ & $2.82$ \ black & $2.86$ & $2.73$ \ other & $3.03$ & $2.86$ \ \hline \end{表格}

## 有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。