How data are stored in computer Quantitative data are stored in a matrix of rows and columns, in which each cell represents a specific data point Each row represents a study participant. Each column represents a variable Typically, the first column contains a variable that idenfiies the participant (or case), often called a case id Fudan University
Fudan University How data are stored in computer ⚫ Quantitative data are stored in a matrix of rows and columns, in which each cell represents a specific data point. ⚫ Each row represents a study participant. Each column represents a variable. ⚫ Typically, the first column contains a variable that idenfiies the participant (or case), often called a case id. 11
Data editor The data editor gives a spreadshee-like view on data, if any, that are currently in memory. You can use it to enter new data, edit existing data and edit attributes of the data in the dataset such as variable names, labels, and display formats, as well as value labels Data editor (edit): Changes the editor to edit mode B Data Editor (Browse Changes the Editor to brow se mode for safely looking at data You can copy and paste data by using the Data Editor Fudan University
Fudan University Data editor 12
pen a data file In stata, we must first open a data file before we can analyze its content, often referred to as"using the data file".The command we will use to read stata data into memory is: ] F 现有的 stata数据 use filename clear Saving a stata data file保存 stata数据 Save <filename>, replace 可以直接将exce中的数据cpy, paste到 stata中 Stat Transfer软件 Fudan University
Fudan University Open a data file ⚫ In stata, we must first open a data file before we can analyze its content, often referred to as “using the data file”. The command we will use to read stata data into memory is: 打开 现有的stata数据 . use filename, clear ⚫ Saving a stata data file 保存stata数据 Save <filename>, replace ⚫ 可以直接将excel中的数据copy, paste到stata 中 ⚫ Stat Transfer 软件 13
Log file(log文件) Results appear only on the stata results window Typically we would like to save these to use when we write about our results in a paper In stata, we accomplish this with the command:使用日志(log)。它可 以帮助我们记录 stata的运行结果。 log using <file name>, replacelappend text log close Replace:覆盖原有的log日志; append:继续写原来的log日 志 Text:可使log日志保存为普通文本格式(可以由任何的文本 编辑器或者word打开)。如果不加text, stata的默认储存格式 是.smc格式,这个格式只能用 stata来打开。 Fudan University 14
Fudan University Log file (log文件) ⚫ Results appear only on the stata results window. Typically we would like to save these to use when we write about our results in a paper. In stata, we accomplish this with the command:使用日志(log)。它可 以帮助我们记录stata的运行结果。 log using <file name>, replace/append text log close ⚫ Replace: 覆盖原有的log 日志;append:继续写原来的log日 志 ⚫ Text: 可使log日志保存为普通文本格式(可以由任何的文本 编辑器或者word打开)。如果不加text, stata的默认储存格式 是.smcl 格式,这个格式只能用stata来打开。 14