version: 3.0.0
help readWind May 19, 2021

Title

readwind - Read the data downloaded from the Wind into Stata in a long form

Syntax

readwind namelist(min=1)
,
key(keywords)
timeType(time type)
t0(start time)
tn(end time)
[type(excel type)
sheet(excel sheet number)
encoding(encoding type)
tostring]

Description

readwind is a command to import downloaded data from the Wind database into Stata more efficiently. Note that, the work (fastreshpe) of Michael Droste helped us to solve the problem of converting the data form of long/wide into wide/long, and it's appreciated.

namelist Namalist is the name of the imported variable, at least one variable.

key keywords of the object excel.

timeType timeType refers to whether the downloaded sample is annual, quarterly, monthly of daily, so its value is y/q/m/d.

t0 Sample start time, for example, if you choose to download it from January 1995, then t0 could be set as 1995m1.
Quarterly and monthly correspond to 1995q1 and 1995 respectively.

tn Sample end time, for example, if your sample deadline is at January 2018, then tn could be set as 2018m1.
Quarterly, monthly and daily are also permitted.

type(file type) sheet(excel sheet number) encoding(encoding type) tostring are optional.
The optional attribute in type is corresponding to your data file, and it can be set to xls, xlsx or csv.
When your dataset is excel format and the suffix of your excel is xls, you should set type(xls), the default is xlsx;
Sheet specifies the number of tables in the object Excel, and the default is set to sheet1.
Note that if your original data is in CSV format, ignore the sheet option, and you can encoding the text to prevent scrambling.
The default encoding is utf-8. Option tostring forces variables to be converted to character type.

Example

cd ".\tagetFile\"

. readwind ROE, key(ROE) timeType(q) t0(1995q1) tn(2017q4)

. readwind ROE ROA, key(ROE_ROA) timeType(q) t0(1995q1) tn(2017q4) type(csv) encoding(gbk) tostring

Author

Hongbing,Zhu (朱红兵)

. Business School, Nanjing University, China.

. E-mail: zhuhong_bing@163.com

Also see

Online: fastreshape