|
|
|
||||
|
Stat Computing > Limdep > FAQ
|
|
||||
Sometimes, you may want to run a sequence of LimDep commands in a row. For example, you start your analysis using pull-down menus and then you want to be able to repeat your analysis. The best way of doing so is to save all the commands that you want to use in a program file. Later on you can use LimDep Run File option to run the program file. You can also run the program file in batch mode on PCs or mainframe machines.
Here is a simple example to demonstrate. We have a data set with 25 observations in ASCII format. We started LimDep and used the pull-down menu Project-Import-Variables to input our data set. After that we ran some descriptive statistics and a linear regression analysis. We also created a binary variable called hcomp. All these commands were issued through the pull-down menus. Now in the Output window below, we see the results together with the commands. We can then copy and paste these commands that we are interested in to a text file using any text editor such as NotePad. Any time if we want to run the same analysis again, we only have to run the file once using the Run File option.
--> RESET --> READ;FILE="E:\DATA\classnotes\spss\hsb25.txt"$ Last observation read from data file was 25 --> DSTAT;Rhs=FEMALE,RACE,SES,SCHTYP,PROG,READ,WRITE,MATH,SCIENCE,SOCST$ Descriptive Statistics All results based on nonmissing observations. =============================================================================== Variable Mean Std.Dev. Minimum Maximum Cases =============================================================================== ------------------------------------------------------------------------------- All observations in current sample ------------------------------------------------------------------------------- FEMALE .400000000E-01 .200000000 .000000000 1.00000000 25 RACE 3.48000000 1.00498756 1.00000000 4.00000000 25 SES 2.16000000 .624499800 1.00000000 3.00000000 25 SCHTYP 1.04000000 .200000000 1.00000000 2.00000000 25 PROG 1.88000000 .725718035 1.00000000 3.00000000 25 READ 54.3200000 10.0570042 34.0000000 73.0000000 25 WRITE 52.4000000 8.45083822 33.0000000 65.0000000 25 MATH 52.2400000 8.97347944 35.0000000 75.0000000 25 SCIENCE 54.3600000 8.98554395 31.0000000 72.0000000 25 SOCST 54.6400000 9.30895626 31.0000000 71.0000000 25 --> REGRESS;Lhs=WRITE;Rhs=FEMALE,ONE,SCIENCE,MATH;Het$ +-----------------------------------------------------------------------+ | Ordinary least squares regression Weighting variable = none | | Dep. var. = WRITE Mean= 52.40000000 , S.D.= 8.450838223 | | Model size: Observations = 25, Parameters = 4, Deg.Fr.= 21 | | Residuals: Sum of squares= 1368.927512 , Std.Dev.= 8.07385 | | Fit: R-squared= .201326, Adjusted R-squared = .08723 | | Model test: F[ 3, 21] = 1.76, Prob value = .18476 | | Diagnostic: Log-L = -85.5098, Restricted(b=0) Log-L = -88.3198 | | LogAmemiyaPrCrt.= 4.326, Akaike Info. Crt.= 7.161 | | Autocorrel: Durbin-Watson Statistic = 2.00351, Rho = -.00175 | | Results Corrected for heteroskedasticity | | Breusch - Pagan chi-squared = .6735, with 3 degrees of freedom | +-----------------------------------------------------------------------+ +---------+--------------+----------------+--------+---------+----------+ |Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X| +---------+--------------+----------------+--------+---------+----------+ FEMALE 5.902259391 2.1745369 2.714 .0130 .40000000E-01 Constant 29.37892069 6.8402923 4.295 .0003 SCIENCE .7674065713E-01 .15578325 .493 .6274 54.360000 MATH .3563048776 .13129934 2.714 .0130 52.240000 (Note: E+nn or E-nn means multiply by 10 to + or -nn power.) --> CREA;hcomp=(write>=60)$The data set and the program file for the above example is here for you to try it out.
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services