stata

Is there a way to access Stata from eclipse?

房东的猫 提交于 2019-12-24 03:18:06
问题 … similar to the StatET plugin that allows you to run R code from Eclipse? I tried googling it but nothing useful has turned up. 回答1: None that I know. If you're a CLI junky or willing to use Emacs, you might find limited support through the ESS package and the ado-mode. This is what I used on Mac OS X when I want to run short snippet of code, or use Stata in batch mode, but there's no interactive graphical output (you can just save graphics as PDF as usual). The ado-mode provides basic

How to avoid duplication of a certain variable during alternative-specific data organization?

时间秒杀一切 提交于 2019-12-24 00:23:37
问题 UPDATE: I apologize for providing a very simplified, non-reproducible example earlier. This is something that can be reproduced: *use this case-specific dataset: week units pr categ id avecenoz1 avecenoz2 avecenoz3 1667 1 0 1 371247 4.276693 4.871173 6.430658 1686 1 0 1 581457 4.372499 5.042025 6.45528 1656 1 0 2 217025 4.107188 4.900006 6.236501 1649 1 0 2 138704 4.355612 4.920326 6.548411 1685 1 0 3 575278 4.297557 4.971671 6.408175 1642 1 0 3 75440 4.290808 4.848145 6.384848 1655 1 0 3

How to keep a list of variables given some of them may not exist?

☆樱花仙子☆ 提交于 2019-12-23 15:27:25
问题 I have 100 dta files. I have a list of variables that I need to keep and save temporary copies on the fly. Some variables may or may not exist in a certain dta . I need Stata to keep all variables that exist in a dta and ignore those that do not exist. The following code has wrong syntax, but it could serve as a good pseudo code to give one a general idea of what should be done: forval j = 1/100 { use data`j' local myVarList ="" foreach i of varlist var1 var2 var3 var4 var5 var6 var7 var8 {

Read multiples of same columns in a fixed width file

孤人 提交于 2019-12-23 12:53:45
问题 Consider the following few lines from a Stata .dct file which defines for Stata how to read this fixed width ASCII file (can be decompressed with any ZIP software on any platform): start type varname width description _column(24) long rfv1 %5f Patient's Reason for Visit #1 _column(29) long rfv2 %5f Patient's Reason for Visit #2 _column(34) long rfv3 %5f Patient's Reason for Visit #3 _column(24) long rfv13d %4f Patient's Reason for Visit #1 - broad _column(29) long rfv23d %4f Patient's Reason

front end in Stata

谁说我不能喝 提交于 2019-12-23 06:07:43
问题 My client has a couple of Stata programs (.do files) that they have been running for a while. Is it possible to have a front end page or a form for Stata so that we can choose different options/criteria and based on the selections certain programs on Stata are run? Basically is there a way of creating a form for Stata programs? 回答1: Stata can be launched in batch mode as stata /b do whatever.do So you can form that whatever.do file using the tools that are convenient for you, and then run it

In-script command to copy all do files in the current directory to another folder in Stata

狂风中的少年 提交于 2019-12-23 04:11:37
问题 The following is the copy command. copy "main.do" "main2.do", replace However, I want to copy all do files in the current directory, and paste to another directory. I hope this is done without me needing to specify the file names of each do file. How is this possible? From link https://www.stata.com/statalist/archive/2006-08/msg00620.html I tried cd "C:\Users\Owner\Google Drive\test" local files : dir "`c(pwd)'" files "*.do" foreach file in `files' { copy `file' "`file'_copied" } so I could

In-script command to copy all do files in the current directory to another folder in Stata

筅森魡賤 提交于 2019-12-23 04:11:09
问题 The following is the copy command. copy "main.do" "main2.do", replace However, I want to copy all do files in the current directory, and paste to another directory. I hope this is done without me needing to specify the file names of each do file. How is this possible? From link https://www.stata.com/statalist/archive/2006-08/msg00620.html I tried cd "C:\Users\Owner\Google Drive\test" local files : dir "`c(pwd)'" files "*.do" foreach file in `files' { copy `file' "`file'_copied" } so I could

foreach loop running but not giving results

家住魔仙堡 提交于 2019-12-23 02:08:15
问题 I am having trouble running a foreach loop. The loop runs without error but gives no output. Can someone tell me what they think might be going on? Many thanks in advance! Here is the code: cd "O:\RESEARCH\ikhilko\Subway Big Data project" local datafiles : dir . files "*.txt" foreach file in `datafiles' { insheet using `file', clear insheet using `file', drop v9-v43 save date1, replace } UPDATE: Interestingly, the code runs when I just type it into the command line, rather than doing it from

how to make tables out for Spearman correlation table? [duplicate]

我只是一个虾纸丫 提交于 2019-12-22 17:50:37
问题 This question already has an answer here : How to export Spearman correlations (1 answer) Closed 3 months ago . I need to get a Spearman and Pearson correlation table using Stata. Here is what I did to get the results in a table format. estpost correlate sp_rating srating mrating split split_neg split_ord split_neg_ord tier1_risk tier1_leverage st1 sl mt1 ml adt1 adl dt1 dl offering_amt maturity2 security enhance timeliness validity disc loan_at cash_dep trading_at real_est intangible other

In Stata, how do I add variable labels from a separate csv file?

对着背影说爱祢 提交于 2019-12-22 12:19:22
问题 I have a set of csv files that are very simple to load into Stata using the -insheet- command. But they have very uninformative variable names. For each of these files, I also have a file of metadata consisting of two columns: the original (uninformative) variable names, and a description of what the variables actually mean. I'd like to use these metadata files to create variable labels, preferably without going through and typing up all the separate label commands or turning the metadata