CRSP

From ISOR
(Difference between revisions)
Jump to: navigation, search
(WEB Access R)
(WEB Access R)
Line 74: Line 74:
 
* http://calc.isor.univie.ac.at:8787
 
* http://calc.isor.univie.ac.at:8787
 
* explore some commands
 
* explore some commands
###### Example#1
+
###### Example#1
 
  ? system
 
  ? system
 
  ? system.time()
 
  ? system.time()
Line 92: Line 92:
 
  tail(MyEGASData)
 
  tail(MyEGASData)
 
  plot.ts(MyEGASData$MPRC)
 
  plot.ts(MyEGASData$MPRC)
######## Example #2
+
######## Example #2
 
  # myTechies <- read.csv('/home/su/crsp/techcompanies.tickers', header = FALSE)
 
  # myTechies <- read.csv('/home/su/crsp/techcompanies.tickers', header = FALSE)
 
  myTechies <- scan(file = 'techcompanies.tickers', what = 'character', sep = ',')
 
  myTechies <- scan(file = 'techcompanies.tickers', what = 'character', sep = ',')

Revision as of 11:16, 17 March 2021

Contents

1 CRSP, COMPUSTAT, CCM

1.1 CUPL Tools

1.1.1 access to your remote text terminal

1.1.1.1 require credentials

email the VDC sysadmin to provide credentials and get your remote text terminal prepared.

  • host: crsp.vdc.univie.ac.at
  • user: your username
  • password: your password

1.1.2 VPN

If working from home you have to establish a Virtual Private Network (VPN) to Uni first (see ZID/VPN).

1.1.3 SSH

If working from Windows, you might need to install an SSH-client (like PUTTY) to use Secure Shell (SSH) to connect to your terminal. Accept the server key.

caption

Also see ZID's explanation

1.1.4 usage of a terminal

Now you work remotely and use the remote host's command line (which is the bash shell, don't type the beginning "$", which is the prompt):

4 terminal session.gif


the midnight-commander (mc) provides a built-in editor mcedit (exit it with Alt+0)

$ mc 
$ mcedit ts_samp7.rqt 

e.g. use ts_print to process a requirementfile ts_samp7.rqt and get the output ts_samp7.out:

$ ts_print ts_samp7.rqt

use mc / mcedit to look into ts_samp7.out:

$ mcedit ts_samp7.out 

caption

use e.g. this command to get the switches for the command crsp_print:

$ crsp_print /d1  /var/crsp/2019-07/crspdata/cmz201807

1.1.5 download the results onto your desktop / laptop

use an SFTP client like CyberDuck on a Mac or WinScp on Windows to download the results (e.g. ts_samp7.out) onto your desktop for further processing. Provide your SSH credentials:

10 cyberduck credentials.png

1.1.6 documentation

Please read some manuals to gain experience with the ts_sampleX.rqt files in your home directory

1.2 WEB Access R

###### Example#1
? system
? system.time()
help crsp         ## we have licensed US-Stock 1925 and US-Indices
system2("uptime") ## load average < 10 !
library(data.table, crsp)
setwd('~/crsp')
getwd()
myheaders <- data.table(crsp.data.usstock('sfz_hdr'))
myEGASHeaders <- myheaders[HTSYMBOL %like% "EGAS" & BEGDT > "1986-01-8"]$KYPERMNO
myMonthly <- crsp.data.usstock("sfz_mth")
nrow(myMonthly)
ncol(myMonthly)
head(myMonthly,10)
MyEGASData <- myMonthly[myMonthly$KYPERMNO %in%  c(myEGASHeaders),]
head(MyEGASData)
tail(MyEGASData)
plot.ts(MyEGASData$MPRC)
######## Example #2
# myTechies <- read.csv('/home/su/crsp/techcompanies.tickers', header = FALSE)
myTechies <- scan(file = 'techcompanies.tickers', what = 'character', sep = ',')
myTechiesHeaders <- myheaders[myheaders$HTSYMBOL %in% c(myTechies)]
#fileDsk <- tempfile("MyTechiesHeaders")
fileDsk <- "MyTechiesHeaders"
#setwd("~/R_workspace/from_uspace/privat/crsp_sample1/")
write.table(t(myTechiesHeaders), file='./MyTechiesHeaders')
# file.show(fileDsk)
# if(interactive()) file.show(fileDsk)
unlink(fileDsk) # tidy up
myTechiesData <- myMonthly[myMonthly$KYPERMNO %in%  c(myTechiesHeaders$KYPERMNO),]
plot.ts(log(myTechiesData$MPRC))


1.2.1 Documentation

in the crsp.org universe.

Personal tools
Namespaces

Variants
Actions
Navigation
Tools