統計分析

Stata: 如何計算不重複值的筆數

Stata 有很多強大的功能,不過卻沒有一個比較簡單的指令可以直接計算不重複值的方法。

不過在這個網站,指出了三種計算不重複筆數的方法,非常強大!

參考資源:http://statadaily.wordpress.com/2010/10/01/ways-to-count-the-number-of-unique-values-in-a-variable/

方法一

tab varname, nofreq
display r(r)

方法二

inspect varlist
display r(N_unique)

方法三

codebook varlist

這三種方法都非常簡單易用,提供給大家作參考!

Stata: 如何計算不重複值的筆數 Read More »

qualitative data analysis

Conceptual framework 與 theoretical framework 大不同

不管是作質化研究或是量化研究,總得寫文獻探討的,但在期刊文章中,特別是人文科學的部分,其實很少人直接用 literature review 這個說法,而是用 conceptual framework 和 theoretical framework。conceptual framework 和 theoretical framework 聽起來很像對不對?其實兩者是不同的

所謂的 conceptual frameworkMiles and Huberman (1994) 所說的是 “A conceptual framework explains, either graphically or in narrative form, the main things to be studies – the key factors, constructs or variables – and the presumed relationship among them.…

Conceptual framework 與 theoretical framework 大不同 Read More »

Stata: 如何輸出robust standard error

快兩周沒更新部落格了,原因有很多,一方面是一篇文章要作minor revision,花了不少時間;一篇要投稿的,要作最後完稿;一方面是最近美股大跌,正忙著研究價值投資,應該買什麼。不是會計專業要學 discounted cash flow、dividend discount model、ROE valuation,還真是困難;一方面是最近迷上了中醫經方傷寒論,忙著學習如何調養身體。不過在美國科學中藥似乎不是很容易購買,還在努力找便宜方便的藥源。Anyway,我好像真的有強烈的學習控~

回歸正題。esttab 可以輸出各種表格,不過有時候某些原因,不想要 standard error,而想要輸出 robust standard error,那應該怎麼作呢?

其實大部分都跟一般輸出一樣,只不過要加點工。

怎麼作呢?首先,用 stata 網路資料庫。

webuse lbw

接下來就是跑 logit。不過與之前指令不同,這要用 eststo 儲存。

eststo: logit low age, robust

1

那要輸出,該怎麼作呢?

esttab using test.rtf,

Stata: 如何輸出robust standard error Read More »

Stata: Oneway ANOVA

今天檢視 Stata 寫過的文章,才發現很簡單的 Anova 沒寫過,馬上補上。

這篇先講 oneway anova,因為 twoway anova 的指令稍微麻煩一點,oneway 比較好作。

要在 Stata 作 oneway anova 非常簡單,基本語法是:

oneway DV IV

DV 是你的依變數 (dependent variable),IV 是依變數或是組別。

用 Stata 內建的資料庫來用的話,範例如下:

sysuse auto <br />oneway price foreign

簡單地說,這是看國產車和進口車是否有價錢上的差異。

1

從結果看出來,兩者之間是沒有價錢上的差異的。

如果除了測試是否有顯著差異,還想要看敘述統計的話,指令要稍微修改一下,可以加上 t 這個 option可以用,t 是 tabulate 的縮略。

oneway price foreign,t

2

如果要比較組與組之間,那還要使用別的 option 才行。Stata 提供 bonferroni, scheffe, sidak 三種比較,語法如下:

oneway price foreign,t bon sid sch

Stata: Oneway ANOVA Read More »

Scroll to Top