set obs isn't relevant to the case where your data are already in memory. It's only needed because I create a fake dataset.
-
Login or Register
- Log in with
*Fixed effects: Heterogeneity across entities (stripplot)
clear
set seed 2803
gen performance = exp(rnormal(-2, 1))
gen type_industry = ceil(_n/ 100)
label def type_industry 1 `" "Basic" "Materials" "' ///
2 `" "Communi-" "cations" "' 3 `" "Consumer" "Cyclical" "' 4 `" "Consumer" "Non-Cyclical" "' ///
5 "Energy" 6 "Financial" 7 "Industrial" 8 "Technology" 9 "Utilities" , modify
label val type_industry type_industry
* get a gmean() function (don't remove the *)
* ssc inst egenmore
* sort on geometric mean (don't remove the *)
* ssc inst myaxis
myaxis xaxis=type_industry, sort(gmean performance)
* ssc inst stripplot
stripplot performance, over(xaxis) centre vertical cumul cumprob refline scheme(s1color) xla(, noticks labsize(small)) xsize(7) xtitle("") ysc(log) yla(5 2 1 0.5 0.2 0.1 0.05 0.02, ang(h)) reflevel(gmean) mc(blue)
set obs 900 set seed 2803
use"File4.dta", clear
*means and standard deviations of intangible assets by industry
preserve
collapse (mean) mean_intangible_assets_industry=intangible_assets (sd) sd_intangible_assets_industry=intangible_assets, by (industry)
asdoc list, replace
restore
*means and standard deviations of intangible assets by year
preserve
collapse (mean) mean_intangible_assets_year=intangible_assets (sd) sd_intangible_assets_year=intangible_assets, by (year)
asdoc list, replace
restore
*descriptive statistics for control variables (average, mean, sd)
asdoc tabstat enterprise_value_added market_capitalization leverage stock_growth dividend_payout_ratio stock_volatility, stat(mean p50 sd), replace
*correlation for control variables
corr enterprise_value_added market_capitalization leverage stock_growth dividend_payout_ratio stock_volatility
*setting panel data
xtset i year
*exploring panel data
xtline ln_firm_performance
xtline ln_firm_performance, overlay
*OLS regression
regress firm_performance intangible_assets
scatter firm_performance intangible_assets, ms(none) ylabel(minmax) xlabel(minmax) mlabel(industry_l) mlabpos(0) || lfit firm_performance intangible_assets, clstyle(p2)
*Fixed effects: Heterogeneity across entities (stripplot)
clear
set obs 900
set seed 2803
gen performance = exp(rnormal(-2, 1))
gen type_industry = ceil(_n/ 100)
label def type_industry 1 `" "Basic" "Materials" "' ///
2 `" "Communi-" "cations" "' 3 `" "Consumer" "Cyclical" "' 4 `" "Consumer" "Non-Cyclical" "' ///
5 "Energy" 6 "Financial" 7 "Industrial" 8 "Technology" 9 "Utilities" , modify
label val type_industry type_industry
* get a gmean() function (don't remove the *)
* ssc inst egenmore
* sort on geometric mean (don't remove the *)
* ssc inst myaxis
myaxis xaxis=type_industry, sort(gmean performance)
* ssc inst stripplot
stripplot performance, over(xaxis) centre vertical cumul cumprob refline scheme(s1color) xla(, noticks labsize(small)) xsize(7) xtitle("") ysc(log) yla(5 2 1 0.5 0.2 0.1 0.05 0.02, ang(h)) reflevel(gmean) mc(blue)
Comment