160 likes | 370 Views
Market Microstructure Lecture 1 Introduction Daniel Sungyeon Kim. Class Outline. Introduction Syllabus SAS. Syllabus - General. Office hours: Mon 10:00AM – 11:00PM , or by appointment E-mail is the best contact method: kimds@phbs.pku.edu.cn
E N D
Market MicrostructureLecture 1 IntroductionDaniel Sungyeon Kim
Class Outline • Introduction • Syllabus • SAS
Syllabus - General • Office hours: Mon 10:00AM – 11:00PM, or by appointment • E-mail is the best contact method: • kimds@phbs.pku.edu.cn • Do not call my office or mobile unless in emergencies • You will need a calculator – no programmable ones in exams! • www.danskim.com: many course materials will be uploaded here. • If you miss a class, get missed materials from other students, not me. • A lot of in-class problems, solutions will not be posted on-line.
Syllabus - Grades • The grades will be curved. • I expect to see about: • 30% of students with 90% or higher • 40% of students with 80% or higher • 30% of students with 70% or higher
Syllabus – Exams / Projects Exams: closed-book, closed-notes, cumulative Mid-term on December 16th, Final schedule not finalized yet
What to be expected in this course A lot of materials A lot of formulas Very big projects (40% of grade Lecture + SAS skills
Rescheduling 12/30 to 1/8: New year’s holiday 1/2 to 12/11: Visit to Shenzhen Stock Exchange 1/6 to 1/12: Group presentation 1/13 to 1/12: Group presentation
Helpful tips We do problems in class. Bring your calculator. Review main concepts from your prior economics or finance classes. Get used to your financial calculator. Start your project as early as possible. Do your share in group projects. Pay attention to uploads in the course website. Do all practice problems.
Basics of SAS SAS is very powerful tool for data management and statistical analysis Finance research requires statistical software which can handle large datasets SAS is the only statistical software which can handle large datasets.
Creating/manipulating variables I Always end procedures with “;” Whenever you need to manipulate data, you need to do so using following steps. You can create a new dataset, or you can overwrite dataset. You can delete the variables that are no longer needed. You can delete observations that are not needed.
Creating/manipulating variables II data corpfin; set financials financials2; peratio=price/eps; If year=2013; If peratio>50 then delete; T=t+1; keep firmid year epsindustry t; run; data corpfin; merge corpfintaq.taq; By firmid year; run;
Other operations I • Proc sort: sorts the dataset by variable proc sort data=corpfin; by industry descending year; run; • Proc means (summary): calculates statistics proc summary data=corpfin; by industry descending year; Output out=sumstat mean(peratio)=ape; run • Libname: assign a path to permanent folder Libnametaq ‘c:\data\taq’;
Other operations II • Retain: retain values from previous rows Data x; Set x; Retain c; By firmid; If first.firmid then c=year; else if year^=. Then c=year; else c=c; Run;
Other operations III • Macro: repeat similar steps Data g; Set _null_; Run; %macro xxx; %do i=1 %to 1000; Data g; Set g x&i; Run; %end; %mend; Xxx;
Other operations III • Macro: repeat similar steps Data g; Set _null_; Run; %macro xxx; %do i=1 %to 1000; Data g; Set g x&i; Run; %end; %mend; Xxx;
Other operations IV • Eventus: perform event studies options comamid=TCP remote=WRDS; signonusername=username passwd=password; rsubmitinheritlib=(work=pcwork); libnamewrds '/home/pku/username/'; options fullstimerps=60; eventusfff=wrds.factors ; request insas=pcwork.vvvautodateest=-46estlen=255minestn=3 ; windows (-5,+5); evtstudyindustry pvaluenosingleperiodnonamesnoplistfamafrench momentum twostepcda tail=1outwin=pcwork.zzz; run; \endrsubmit;