0 Up votes0 Down votes

60 views4 pagesBasic commands of Shazam in Stata language

Jan 20, 2014

© Attribution Non-Commercial (BY-NC)

PDF, TXT or read online from Scribd

Basic commands of Shazam in Stata language

Attribution Non-Commercial (BY-NC)

60 views

Basic commands of Shazam in Stata language

Attribution Non-Commercial (BY-NC)

- Simple Linear Regression and Correlation
- Research Proposal for MBA
- Week1 SuggestedProblems Chapter 4
- Change Point Analysis
- Slaughterhouses and Increased Crime Rates
- A List of R Commands
- Democracy + Education_Glaeser
- Syllabus EC655 Fall 2011
- Play It Again With Feeling: Computer Feedback in Musical Communication of Emotions
- Effects of Hub-and-Spoke Free Trade Agreements on Trade: Panel Data Analysis
- Fx of Hub and Spoke Fta
- Regress
- Stat 371 Ass#1
- 10846-32526-1-PB
- Statistical Inference After Model Selection_2009
- 2013QMEA Lecture05 MLR Asymptotics
- Remittances, Financial Development and Growth - Giuliano , Arranz
- Health
- Problem Sets (Days 1-6)
- Rats

You are on page 1of 4

In each case, the SHAZAM command is followed by an explanation of the corresponding command(s) to use with Stata. Stata has a set of comprehensive reference manuals that discuss these commands, options, and much more. PAR Both Shazam and Stata keep all data and calculations in the computers main memory and the size of the memory area used by the program can be set manually. The PAR command sets memory in units of 1K (1024 bytes), so PAR 1000 would set memory at 1Mb. The equivalent Stata command is: SET MEMORY 1m FILE (Unit) Filename This command assigns a number (unit) to a file (Filename) from which the Shazam will read or to which it will write. In Stata, the file from which data are to be read is specified by, USE Filename.dta, clear The option, clear, allows the data file to be used again if the command file is used interactively. The output can be written to a file by using the command, LOG USING Filename.out, text replace The options, text and replace tell Stata the format to use for the output file and allow the file to be replaced in subsequent runs of the same command file. To reduce the amount of information in the log file, logging can be turned on or off with the LOG on and LOG off commands respectively, SAMPLE 1 n This command tells Shazam which contiguous (sub)set of observations to use in its calculations. In Stata, this is handled on a case-by-case basis as an option to the specific command. See OLS below for an example. READ (Filename) A B C Shazam uses this command to assign variable names to numbers in the dataset. In Stata, the variable names are established when the dataset is created and the information is contained in the data file. Therefore, this command is not necessary in Stata and the variable names can be seen in the variables window. STAT A B C/pcor This command calculates descriptive statistics for the variables indicated. The option, pcor, calculates a correlation matrix of the variables. Stata uses the command, SUMMARIZE A B C to calculate the descriptive statistics and a separate command, CORRELATE A B C

2

to calculate the correlation matrix. GENR A = P + Q This is used in Shazam to generate new variables from existing variables. The Stata command is similar, GENERATE A = P + Q or, GEN A = P + Q OLS A B C / RSTAT AUXRSQ Ordinary Least Squares Regressions are calculated in Shazam with the OLS command followed by a slash (/) and options. The first variable listed (A) is the dependent variable and the remaining variables are the independent variables in the regression. The basic form of the OLS command in Stata is REGRESS A B C Which calculates the regression coefficients, standard errors, P-values, and 95% confidence intervals for the coefficients as well as the R2 and F-statistic for the model as a whole. Stratified regressions can be run on sub-samples of the data by adding an if clause or an in clause to the command. An if clause is equivalent to Shazams SKIPIF command. For example, REGRESS A B C if C==2 would run the regression using only the observations in which C equals 2. Note that the double equal sign is used to establish equality with a constant value. One could also have, REGRESS A B C if C<=2 REGRESS A B C if C=D Shazams versions would be SKIPIF(C.LE.2) and SKIPIF(C.EQ.D) respectively. To restrict the regression to a contiguous subset of the data, you can use an in clause to limit the command to a particular range of data. This is equivalent to Shazams SAMPLE command. For example, REGRESS A B C in 5/50 Is equivalent to running the regression on observations 5 through 50 (SAMPLE 5 50). The common options in Shazam, RSTAT for the residual statistics as a check for autocorrelation, and AUXRSQ to calculate the R2 values for the auxiliary regressions as a check for multicollinearity. The Stata equivalent for the AUXRSQ command is to type the command,

3

VIF immediately following the REGRESS command. This will calculate the variance inflation factors for the auxiliary regressions. The factors relate to Shazams R2 results in that, VIF = an R2 or 0.80 corresponds to a VIF of 5.

1 . Thus, 1 " R2

With time series data, we may want to test for autocorrelation. Shazam uses the RSTAT command to calculate residual statistics including the Durbin-Watson statistic. Using ! Stata, one must first designate the data as time series using the command, TSSET preceding the REGRESS command. If there is a specific variable in the data set that designates the time index, it can be shown by, TSSET X (where X is the variable representing the time index). Following the REGRESS command with the command, DWSTAT to calculate the Durbin-Watson statistic for the regression. DIAGNOS HET This is used in Shazam to calculate several Chi2 statistics designed to diagnose heteroskedasticity. In Stata, these tests are done step-by-step entering commands for the specific tests one wishes to use. The commands for these tests are entered immediately after the REGRESS command. Some common Chi2 tests are, HETTEST (the Cook-Weisburg test) WHITETST (Whites test) It is also quite easy with Stata to examine the residual plots to see whether they are approximately normally distributed. Enter the following two commands directly after the REGRESS command, PREDICT RSTD, rstudent KDENSITY RSTD, normal The first Stata command generates a variable RSTD which holds the (normalized) residuals from the regression. The second command then plots these residuals against a normal density function and displays a graph which can be saved or printed. OLS A B C/HETCOV The HETCOV option in Shazam uses Whites panel-corrected covariance matrix to adjust for heteroskedasticity. The equivalent option in Stata is, REGRESS A B C, robust AUTO A B C This Shazam command executes a Cochrane-Orcutt regression to take into account autoregressive errors. The Stat command (assuming a time index variable of X) is,

4

TSSET X PRAIS A B C, corc The Durbin-Watson statistic is automatically reported. The robust option can also be used with the PRAIS command. If the corc option is omitted, then the regression uses the Prais - Winsten method of correcting the model for autocorrelation. 2SLS A B C (C D E) This is a two-stage least-squares model in Shazam in which A and B and endogenous and C, D, and E are exogenous variables. It would be estimated in Stata by using the command: IVREG A (B = D E) C Which specifies D and E as instruments of B in this instrumental variables regression. PROBIT A B C LOGIT A B C TOBIT A B C or TOBIT A B C/upper The Stata methods for estimating models with binary dependent variables (PROBIT and LOGIT) and censored dependent variables (TOBIT) are respectively, PROBIT A B C LOGIT A B C TOBIT A B C, ll(#) where ll (double el) specifies a lower limit of #. Upper-level censoring is specified with ul(#). SKIPIF Shazam uses this command to skip observations that meet certain criteria. In Stata, the observations to be used are specified as an option to a command, not as a separate command. See an example in the discussion of OLS. STOP This must be the last command in a Shazam file. There is no requirement that a Stata do file end with any particular command. However, good practice suggests ending a Stata file with, CLEAR in order to purge the data space in preparation for additional work.

- Simple Linear Regression and CorrelationUploaded byMajmaah_Univ_Public
- Research Proposal for MBAUploaded byAndy Phuong
- Week1 SuggestedProblems Chapter 4Uploaded byjessssssse
- Change Point AnalysisUploaded bymamuro
- Slaughterhouses and Increased Crime RatesUploaded byVegan Future
- A List of R CommandsUploaded byHaritha Atluri
- Democracy + Education_GlaeserUploaded bydiegojo
- Syllabus EC655 Fall 2011Uploaded bynooriaan
- Play It Again With Feeling: Computer Feedback in Musical Communication of EmotionsUploaded byEsteban Algora Aguilar
- Effects of Hub-and-Spoke Free Trade Agreements on Trade: Panel Data AnalysisUploaded byAsian Development Bank
- Fx of Hub and Spoke FtaUploaded bymzholda
- RegressUploaded byAtreya Chakroborty
- Stat 371 Ass#1Uploaded bylive2smile89
- 10846-32526-1-PBUploaded bydocbiswas
- Statistical Inference After Model Selection_2009Uploaded bygirellibruni
- 2013QMEA Lecture05 MLR AsymptoticsUploaded byเป๋าเด็ดกระเป๋าคุณภาพราคาถูก
- Remittances, Financial Development and Growth - Giuliano , ArranzUploaded byevamcbrown
- HealthUploaded byAhmed Gouda
- Problem Sets (Days 1-6)Uploaded byHarry Kwong
- RatsUploaded byNirmal Singhania
- Airport QualityUploaded byNessa Nesscht
- Script_ASR_v161212 (1)Uploaded byAbhimanyu Sahai
- Multiple Linear Regression Model with Two Parameter Doubly Truncated New Symmetric Distributed ErrorsUploaded bytheijes
- syllab705_17Uploaded byRohit
- Mendelian Randomization With a Continuous OutcomeUploaded byscjofyWFawlroa2r06YFVabfbaj
- 14Uploaded bychenk194
- Marquez_-_Martinez_Technological_Innovation_cor_6.pdfUploaded byManish Sharma
- A Stat501 Introduction 2Uploaded byMurali Dharan
- Evaluation of the Quality of a Prognosis for an Industrial Product using the Regression AnalysisUploaded byEditor IJTSRD
- WallaceUploaded byOIB

- Cardan and CryptographyUploaded byAshish Yadav
- The Human Body in an Electric UniverseUploaded byAnthony E. Larson
- Origami Bonsai Electronic Magazine Volume 3 Issue 2Uploaded byBenjamin John Coleman
- DGS IE 003 R0 Control ValveUploaded byMarcelo Peretti
- Pasoe AdministrationUploaded bykeytasks
- 5S07 Y. KuznetsovUploaded byMrManager
- Dry Gas Seals SiemensUploaded byahbabar808
- A Short Measure of TlUploaded byلوجي نين
- MSP Design WorkshopUploaded byBouhafs Abdelkader
- Anti-Surge Control Final of FinalUploaded byOutofbox
- SIL03-2CUploaded bydzakub
- BX_SOL_DS_T800999_enUploaded byGrace Zulueta
- Popular Woodworking 2000-02 No. 113Uploaded byMiguel A. Ramirez
- CDS - Bloomberg FunctionsUploaded bymiksys
- Introduction-to-Renewable-Energy-for-Engineers-1st-Edition-Hagen-Solutions-Manual.pdfUploaded bya390573370
- Lexique Anglais FrançaisUploaded bylordofwar
- Creating GWT Application Using EclipseUploaded byMahesh Jagadale
- Chemistry Course OutlineUploaded byAbdulaziz Farhan
- Dc Bus Voltage ControlUploaded byHolik Okdiansyah
- Rubik4x4x4SolutionHardwickSpeed.pdfUploaded byJoshua Victor
- Probability & Prob. DistributionsUploaded byJinoy P Mathew
- electronic_cash_register_xea203.pdfUploaded byakeboshi4
- Fluid Mechanics NotesUploaded byguptaranjeet40
- Fick's Laws of DiffusionUploaded byEn Csak
- Benefit of Concrete ConstructionUploaded byyogaanu
- UntitledUploaded bysinghalmayank950
- 268 Impladent Sti Bio c Bioactive Titanium en WebUploaded byhaneefmdf
- Chapter 04 HW 04Uploaded byYeni Mulyani
- 22 ejercicioUploaded byMarilyn Stefania
- Sensor de Temperatura FanCoil Ec Sensor DatasheetUploaded byJoseph

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.