我的代码应该很容易编写成pdf,但是它不会编译,我在中得到了这个消息:
好了!LaTeX错误: Unicode字符₁(U+2081)未设置为与LaTeX一起使用。
错误: LaTeX未能编译L-work-5.tex。有关调试技巧,请参见https://yihui.org/tinytex/r/#debugging。有关更多信息,请参见L-Wor-5.log。执行暂停
以下是代码:
---
title: "work 5"
author: "PLars"
date: "4/2/2022"
output: pdf_document
fonttheme: professionalfonts
fontsize: 12pt
editor_options:
markdown:
wrap: 72
---
```{r, echo = FALSE, results = "hide", message = FALSE, purl = FALSE}图书馆(针织品)
opts_chunk$set(tidy = FALSE,
fig.align = "left", background = '#a6a6a6', fig.width = 10, fig.height = 10, out.width ="\\linewidth", out.height = "\\linewidth", message = FALSE, warning = FALSE, fig.align = "left" )选项(宽度= 55,数字= 3)
图书馆(天平)
<-函数百分比(x,位数= 2,格式= "f",.){
paste0(formatC(100 * x,格式=格式,数字=数字,.),"%")
}
图书馆(港湾)
图书馆(丁锡)
图书馆(望星者)
图书馆(Tidyverse)
图书馆(文本)
图书馆(Dplyr)
图书馆(文本)
图书馆(AER)
图书馆(Tidyverse)
**Part I - Categorical Models (5 points)**
Say that you estimate an ordered logit model with a three category
dependent variable and two independent variables, X~₁i~ and X~₂i~, and
obtain the following results:
```{=tex}开始{中心]
开始{tabular}{c\rc}
赫林
&$\hat{\β}$& SE
\hline
$X_{1}$ &0.68$& $(0.23)$ \
$X_{2}$ & $-0.47$ & $(0.13)$ \
\hline
$\tau_1$ & $-1.02$ & $(0.46)$ \
$\tau_2$ & $.85$ & $(0.21)$ \
\hline
结束{表格}
结束{中心}
```{=tex}开始{枚举}
\项目计算$\Pr(Yi=1 X{1i}=1,X_{2i}=0)$。
\项目计算$\Pr(Yi=2 X{1i}=1,X_{2i}=0)$。
\项目计算$\Pr(Yi=3 X{1i}=1,X_{2i}=0)$。
\项目计算第一个差异(类别中的概率差),即将X{2i}从-2改为2,将X{1i}固定在0。对Y_i的每个可能值进行计算。
解释如何评估平行回归假设是否适用于这个模型?如果没有,如果这是你的模式,你会有什么选择呢?
结束{枚举}
#
First, we calculate $X_i \beta$
```{r}(xiB <- (-.0681) + (-0.470))
Then, plug into the following equations:
```{r}(prob1 <- 1/(1 +exp(-(-1.02-xiB)
(prob2 <- 1/(1 +exp(-(.85-xiB)- prob1)
(prob3 <- 1- (1/(1 +exp(-(.85-xiB)
prob1 + prob2 + prob3
发布于 2022-04-03 00:22:08
首先,尝试删除行中的特殊字符₁和₂。
双自变量,X~₁i~和X~₂i~
这将使您可以编译。
你也许可以通过包括这样的东西来让它工作起来
\newunicodechar{₁}{\ensuremath{{}_1}}同样,对于下标-2字符,在你的文件顶部(从this TeX Stack Exchange question),但我还没有测试它,不想现在进入兔子洞.
或者只需将相关文本更改为
two independent variables, $X_{1i}$ and $X_{2i}$这可能会排版它的原意!
https://stackoverflow.com/questions/71721931
复制相似问题