2013-04-29 148 views
0

這是關於Stata中的用戶命令Concindexi,其用於計算concentration index。有關Concindexi的定義和詳細信息對於回答以下問題不是必需的。Stata中的用戶命令concindexi中的輸出矩陣

爲了解釋這個問題,我使用Stata庫中的自動數據(這個函數不是爲了這種類型的數據,而是用於家庭數據)。

以下是語法:

concindexi [varlist] [if] [in] [weight] [ , welfarevar(varname) format(format) 
    curve convenient clean } 

我使用的weightrank作爲welfare variable

sysuse auto 
egen weightrank=rank(weight) 
sort weightrank 

price濃度指數被給定爲

concindexi price, welfarevar(weightrank) 

輸出(迄今沒問題)

Concentration index estimation using the covariance/formula method 

Final matrice of Concentration Indices on Individual (Micro) Data. 

      CIF  CISEF 
price .14318137 .02934612 


CIF : Concentration index using formula/covariance method 
CIC : Concentration index using convenient regression method 
CISEF : Standard errors of the concentration index using formula/covariance method 
CISEC : Standard errors of the concentration index convenient regression method 

這裏的問題是:如果我重複使用相同的命令相同的變量price(無需重新啓動Stata),它現在將給予2 * 2的矩陣(結果得到累積)。

concindexi price, welfarevar(weightrank) 

輸出:

Concentration index estimation using the covariance/formula method 



Final matrice of Concentration Indices on Individual (Micro) Data. 


      CIF  CISEF 
price .14318137 .02934612 
price .14318137 .02934612 


CIF : Concentration index using formula/covariance method 
CIC : Concentration index using convenient regression method 
CISEF : Standard errors of the concentration index using formula/covariance method 
CISEC : Standard errors of the concentration index convenient regression method 

如果我再次重複同樣的命令,我有3×2矩陣。

concindexi price, welfarevar(weightrank) 

Concentration index estimation using the covariance/formula method 



Final matrice of Concentration Indices on Individual (Micro) Data. 


      CIF  CISEF 
price .14318137 .02934612 
price .14318137 .02934612 
price .14318137 .02934612 


CIF : Concentration index using formula/covariance method 
CIC : Concentration index using convenient regression method 
CISEF : Standard errors of the concentration index using formula/covariance method 
CISEC : Standard errors of the concentration index convenient regression method 

通常情況下,我們預計1×2矩陣不論多少次執行該命令而在Stata同一會話[就拿命令regress。但是,如果我們每次重新啓動Stata,問題就會消失。

這個問題對於這裏提到的例子並不嚴重。但是,如果變量的數量很大(它可以容納大的變量)和/或如果我必須引導,問題就會變得非常嚴重。例如,在我有13個變量和20000個觀測值的數據中,[bootstrapping]中的複製可能只有29次,但對於2個變量,對應的數字是100.任何解決此問題的想法都將得到高度讚賞。

回答

2

concindexi是SSC提供的用戶編寫的命令(非功能)。

在Stata中,命令和功能非常獨特。

在Stata的討論中,指出命令來自何處是有幫助的;這對於Statalist來說肯定是強有力的建議(見http://www.stata.com/support/faqs/resources/statalist-faq/),這似乎是對其他論壇的公平要求。

解決方案已記錄在案。有一個選項cleanconcindexi,它刪除以前由程序創建的矩陣和標量。據推測,作者建立在結果積累上是他(可能還有他的用戶)想要的一個特徵。作爲一種Stata編程風格,這是不尋常的行爲。我們可以討論它是多麼好的風格,但作爲提供覆蓋它的一種方式,這歸結於個人的品味。顯然你對這種行爲感到驚訝,我也會這麼做,因爲它只是通過clean選項間接記錄。

嚴格來說,「關於concindexi的定義和細節對於回答問題來說並不是必需的」,這是相當不正確的。答案取決於尋找代碼並閱讀它的文檔,這種行爲不會引發Stata問題。

+0

@ Nick:我同意你的意見。非常感謝! – Metrics 2013-04-29 16:02:58

+0

@ Nick:我用'question'中的命令替換了函數。 – Metrics 2013-04-29 16:04:41

+0

感謝您的修復。 – 2013-04-29 16:06:46