-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHu_Outline of R Workshop.tex
184 lines (172 loc) · 6.16 KB
/
Hu_Outline of R Workshop.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
\documentclass[12pt]{scrartcl}
%\documentclass[12pt,abstracton]{article}
\usepackage[english]{babel}
\usepackage[letterpaper,margin=1in,footskip=.5in]{geometry} %left=0.6in,right=0.6in,top=1in,bottom=1in 用于细致调整
\usepackage[tbtags]{amsmath}
%Place equation numbers on the left by adding [leqno]; [tbtags] ‘Top-or-bottom tags’ For a split equation, place equation numbers level with the last (resp. first) line, if numbers are on the right (resp. left).
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
\usepackage{times}
\usepackage{setspace}
\usepackage{paralist}
\usepackage{titling}
\usepackage{graphicx} %Graph
\usepackage{amssymb} % Math
\usepackage{fancyhdr} %Header set
\usepackage{indentfirst} %indent at the first paragraph
\usepackage[sort&compress]{natbib} %3 lines from here Bibliographic; sort & compress orders multiple citations into the sequence in which they appear in the list of references+;but in addition multiple numerical citations are compressed if possible (as 3-6, 15)
\usepackage[utf8]{inputenc}
\bibpunct{(}{)}{;}{a}{}{,}
\usepackage{booktabs} %thinner lines in table
\usepackage{dcolumn} %aligning decimal points
\usepackage[table]{xcolor} %highlight parts of a table
\usepackage[T1]{fontenc} %dealing with "<>" unable to appear problems
\usepackage{multirow} %merge rows in table
\usepackage[labelfont=bf]{caption} % Border the caption includiong"Figure." and "Table."
\usepackage{rotating} %rotate tables which are too wide
\usepackage{tablefootnote} %Maintain footnotes appearing in table
\usepackage[capposition=top, font=scriptsize]{floatrow} % adding notes for the figures
\usepackage{subfigure} %纵排二图
\usepackage{appendix} %精细化附录
\usepackage[colorlinks,
linkcolor=red,
anchorcolor=blue,
citecolor=black
]{hyperref} %bookmark
\usepackage[capitalise,noabbrev]{cleveref} %automatically detect type of reference by label, using \cref{key} instead of \ref{key}; at the begining of sentences, use \Cref{key}
\interfootnotelinepenalty=10000 %Keep long footnote together
\author{Yue Hu}
\def\Tiny{\fontsize{5pt}{5pt} \selectfont} %choose font smaller than \tiny, the smallest size is 5pt.
%Subtitle Codes
\makeatletter
\def\s@btitle{\relax}
\def\subtitle#1{\gdef\s@btitle{#1}}
\def\@maketitle{%
\newpage
\null
\vskip 0em%
\begin{center}%
\let \footnote \thanks
{\LARGE \@title \par}%
\if\s@btitle\relax
\else\typeout{[subtitle]}%
\vskip 0pc
\begin{large}%
\textsl{\s@btitle}%
\par
\end{large}%
\fi
\vskip 1em%
{\normalsize
\lineskip .em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
\vskip 0em%
{\normalsize \@date}%
\end{center}%
\par
\vskip 0em}
\makeatother
% This code puts the section numbering in the margins
%\renewcommand*{\othersectionlevelsformat}[1]{%
% \makebox[0pt][r]{%
% \csname the#1\endcsname\enskip}%
% }
\begin{document}
\title{Outline of R Workshop}
\date{\today}
\maketitle
%\doublespacing
\setlength{\parindent}{2em} %段前空格
\section{Purpose}
\begin{itemize}
\item Displaying the features, advantage, and disadvantages of R (comparing to STATA).
\item Introducing the basic knowledge of statistical analysis and programming in R.
\item Showing the means and resources to self learn R.
\end{itemize}
\section{Schedule (Brief)}
\begin{itemize}
\item[Day 1] (1 hour) Overview of R:
\begin{enumerate}
\item What is R?
\item Why do we learn R (as a beginner of programming/ as a STATA user)?
\item What R can do but STATA can't?
\item Install R and Rstudio
\item How to incorporate R with Github.
\end{enumerate}
\item[Day 2] (1.5 hours) Basic R
\begin{enumerate}
\item How to create vectors, lists, matices, and datasets?
\item Use R as an advanced calculator.
\item How to input, output data and set working directions?
\item Introduction of common R packages.
\end{enumerate}
\item[Day 3] (1.5 hours) Data Manipulation
\begin{enumerate}
\item How to use filter rows?
\item How to select columns (variables)?
\item How to create new variables based on the existing ones and how to arrange them?
\item How to bind data (long to wide, wide to long, merge, append)?
\item An introduction of piping programing
\end{enumerate}
\item[Day 4] (1.5 hours) Data Analysis and Programming
\begin{enumerate}
\item How to do descriptive statistics in R?
\item How to do t-test and ANOVA in R?
\item How to do OLS in R?
\item Introduction of basic MLE models in R.
\item Multiple Imputation and Factor Analysis (optional)
\end{enumerate}
\item[Day 5] (1.5 hours) Visualization and Output
\begin{enumerate}
\item Introduction of ggplot2.
\item How to do descriptive graphs (histgram, density, frequency)?
\item How to graph the regression results?
\item How to present interaction?
\item A very brief introduction of Latex.
\item How to incorporate R output (tables and figures) with Latex.
\end{enumerate}
\end{itemize}
\section{Examples}
Table
% Table created by stargazer v.5.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu
% Date and time: 周三, 7月 29, 2015 - 10:18:34
% Requires LaTeX packages: dcolumn
\begin{table}[!htbp] \centering
\caption{}
\label{}
\begin{tabular}{@{\extracolsep{5pt}}lD{.}{.}{-3} }
\\[-1.8ex]\hline
\hline \\[-1.8ex]
& \multicolumn{1}{c}{\textit{Dependent variable:}} \\
\cline{2-2}
\\[-1.8ex] & \multicolumn{1}{c}{mpg} \\
\hline \\[-1.8ex]
cyl & -0.942^{*} \\
& (0.551) \\
& \\
hp & -0.018 \\
& (0.012) \\
& \\
wt & -3.167^{***} \\
& (0.741) \\
& \\
Constant & 38.752^{***} \\
& (1.787) \\
& \\
\hline \\[-1.8ex]
Observations & \multicolumn{1}{c}{32} \\
R$^{2}$ & \multicolumn{1}{c}{0.843} \\
Adjusted R$^{2}$ & \multicolumn{1}{c}{0.826} \\
Residual Std. Error & \multicolumn{1}{c}{2.512 (df = 28)} \\
F Statistic & \multicolumn{1}{c}{50.171$^{***}$ (df = 3; 28)} \\
\hline
\hline \\[-1.8ex]
\textit{Note:} & \multicolumn{1}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\
\end{tabular}
\end{table}
\clearpage
\bibliographystyle{ajps}
\bibliography{E:/Dropbox_sync/Dropbox/Jabref}
\end{document}