Quantcast
Channel: The Stata Blog - Latest Comments
Viewing all 1129 articles
Browse latest View live

Re: An introduction to the lasso in Stata

$
0
0

Is there a location for the dataset hsafety2?


Re: Bayesian inference using multiple Markov chains

$
0
0

Thank you for sharing the bayesparallel command: Very useful and fast.

Re: Structural vector autoregression models

$
0
0

Hello Glacer, please have you received an answer on how to retrieve the structural shocks

Re: Flexible discrete choice modeling using a multinomial probit model, part 1

$
0
0

Have you got the answer for the multiplying of 2 to set the scale for base alternative?

Re: Flexible discrete choice modeling using a multinomial probit model, part 1

$
0
0

Hello Goerg, could you please elaborate why you multiply the matrix again by 2 ? As you already normalized it by setting one of the variances difference to 1.
Thanks
Shah

Re: Creating Excel tables with putexcel part 3: Writing custom reports for arbitrary variables

$
0
0

Hi Chuck,

I'm using putexcel and very similar nested loop as those shown above. It's running a fair bit slower than I would have expected. I'm outputting about 15 columns and 100 rows of text and data to create an automated report. This is taking over an hour at times. Any ideas of why it could be running slow or suggestions for speeding it up?

It looks like this:

putexcel set "..\Output\Tableset 2.xlsx", sheet("`outcome'", replace) `update'

local charnum = 97
local rows = _N
local outrows = `rows'+3

* Title and subtitle
putexcel A1 = "`title'"

putexcel A2 = "`subtitle'"

* Main body
foreach var of varlist v1-v22 {
noi display "exporting variable: `var'"
forvalues row = 1/`rows' {
local outrow = `row'+3
local col = char(`charnum')
local val = `var'[`row']
putexcel `col'`outrow' = "`val'"
}
local ++charnum
}

Re: An introduction to the lasso in Stata

$
0
0

Typically researchers use adaptive lasso as a model selection device: to select covariates. However, they re-estimate the model with the selected covariates in the second step, and this method is called post-adaptive lasso.

Can someone help me to understand why one would want to report coefficients from a post-adaptive lasso model rather than from the original adaptive lasso procedure?

Thank you very much

Re: New Wooldridge edition just made available

$
0
0

My name is Nancy Medina. I am a PhD student at FLACSO-ECUADOR and a professor at the Central University of Ecuador.

Please if you can help me. I need to estimate a probit model with panel data and instrumental variables, it is the second part (instrumental variables) where I have a problem. Thank you very much


Re: Import COVID-19 data from Johns Hopkins University

$
0
0

this is great. but what I would like is more denominator data--- ie populations by state and country

Re: Update to Import COVID-19 post

$
0
0

As a matter of fact, this character "ï" in the first variable name comes from the byte order mark (here it's "EF BB FF" in hexadecimal). To deal with this, add the option "encoding(utf-8)" to -import delim-. See https://en.wikipedia.org/wi...

Re: Update to Import COVID-19 post

$
0
0

Just one quick note for cleaning purposes, along the way UK has been recoded as United Kingdom in the John Hopkins Dataset. Pre-cleaning, there are two data sets for the UK data

Re: Update to Import COVID-19 post

Re: Update to Import COVID-19 post

$
0
0

This is very useful! Thank you! I found an error in one line for Brazil. I know you are only using the data repository, but I think it underscores that users need to check the data carefully for consistency.

Re: Update to Import COVID-19 post

$
0
0

I tried to download and install your ado, but I am not getting the merged data set. It only saves separate files by date and stops at that point on my computer following your instructions.

Re: Update to Import COVID-19 post

$
0
0

Nice program. I noticed that the variable "lastupdate" takes different format, specifically from 02/02/20 (even seconds have been included). How this could be fixed?


Re: COVID-19 time-series data from Johns Hopkins University

Re: COVID-19 time-series data from Johns Hopkins University

$
0
0

Thanks. Very informative explanation. How about forecasting of COVID19?

Re: Adding recession shading to time-series graphs

$
0
0

Awesome post! Here is a modification of the solution based on methods Nick Cox discusses in Speaking Stata: Shading zones on time series and other plots.

clear all

import fred UNRATE USRECM, daterange(1990-01-01 .)

keep if UNRATE < .
generate datem = mofd(daten)
tsset datem, monthly
label variable UNRATE "Unemployment Rate"
label variable USRECM "Recession"

** Set y-axis limits and tick interval
local ymin = 0
local ymax = 12
local ystep = 2

** Set time axis limits and tick interval
local tmin 1990m1
local tmax 2020m1
local tstep 60 // every 5 years

** Create bar variable for recession shading
tempvar recessionbar
gen `recessionbar' = `ymax'
lab var `recessionbar' "Recession"

twoway ///
(bar `recessionbar' datem if USRECM==1, base(`ymin') col("217 217 217%60") fi(100) lw(0)) ///
(tsline UNRATE, lc(blue)), ///
yla(`ymin'(`ystep')`ymax') yti("Percent, SA") ///
tlabel(`tmin'(`tstep')`tmax', format(%tmCCYY)) ///
plotr(m(t=0 b=0 l=0)) ysc(noex)

Re: COVID-19 time-series data from Johns Hopkins University

$
0
0

This is a great post. There are a lot of useful techniques here. Other posts with examples of reading, manipulating and analyzing data would be welocme

Re: Fitting distributions using bayesmh

$
0
0

Thank you very much for the information. But how can I determine how to use them? If I have a continuous DV, shall I use the exponential distribution? If it is an ordinal DV, then it is poisson distribution? Thank you very much for the explanation.

Viewing all 1129 articles
Browse latest View live