Quantcast
Channel: Statalist
Browsing all 65561 articles
Browse latest View live

Importing a Calendar to Stata

I have a dataset for hospitalization procedures by date for a 10 years period. I would like to know if those procedures where perfomed on business days or not. With the -dow- function, I know if it...

View Article


egen

Dear Statalisters, Below I present a few observation of a panel data set. The data is organized by firm and year. Within each firm year, the firm could have multiple patents, these patents have a...

View Article


Time-varying Cox PH model with episode splitting – specifying vce(cluster...

Dear Statalisters, I have a dataset in which I am studying mortality risk in a cohort using Cox PH model. The main exposure of interest is time-varying, and I have used episode-splitting so that a...

View Article

Diff-in-Diff regression with panel data using weights from psmatch2: How to...

Dear all, I am using the current Version Stata 14 on Windows. First, I want to provide a short explanation of what my analysis is: I have an unbalanced panel of firm data for the years 2000-2014. I...

View Article

What is the best way to plot regression weights, including interaction from...

I have developed a SEM model (latent growth model to be precise) that regresses a latent variable (the latent intercept) on several dichotomous predictors. Trouble is, I also test for interactions,...

View Article


Creating difference from the average of the previous period without using...

Hey, Currently I am trying to create differences from the Rate with the Mean_A of the previous period. So for the 2006m2 observations I want to create the difference 4 - 4.25 = -0.25, the next one 4.4...

View Article

ml program question: right syntax to call parameters of an equation

I want to display and use a component of an equation in my ml program, but I couldn't find the right syntax that would call it. lnsigu2 is modeled with a constant and x1, but all of the last three...

View Article

Export summary statistics using tabstat and estpost (esttab)

Hello, after reading through the forum I found that esttab often causes issues. I hope you can help me with my problem. I am trying to create a table in stata and export it to Word. In Stata this works...

View Article


Deciles of variable from entire dataset based on breakpoints of variable from...

Dear community, my name is Batuhan and I am new to stata. I have one problem that I am dealing with for a long time now and could not resolve yet. I hope you can help me. I have monthly stock return...

View Article


Deleting by ID

Hey guys, First of all , i'm German,so please excuse My english :D. I have one big Problem. I got a dataset Based on Gyms. Every Gym got an ID ( f.e 2001 / 2002 / 2003 etc. ). To every Gym 2-10 People...

View Article

Outreg2 Summary Stats: How to treat zeros as missing

Dear Users, I work with survey data and there are two types of questions. First type is basic demographics which were asked everyone and the second type is entrepreneurship related questions which were...

View Article

Count distinct observations per row for several variables

Dear Users, I have a dataset that contains many variables, but in this instance 84 variables of interest (cal_MeX where X=11-17, 21-27, 31-37, 41-47; cal_MiX where X=11-17, 21-27, 31-37, 41-47;...

View Article

WTP econometric models

Hi statalist users, I'm trying to estimate WTP values ​​for three different types of public services, ( water supply, aqueduct and waste management ) . So my first thought is use a multinomial logit...

View Article


Using assert with missing observations

Dear all Suppose i have a dataset with 5 variables. var1 and var2 have 100 observations while var3, var4 and var5 look like this: Code: var3 var4 var5 54 12 . 56 15 167 89 17 190 34 18 198 . . . . . ....

View Article

Saving regression results

How do I save and use regression results. I want to run an OLS regression of the kind: reg X1 L.X1 L.X2 and then use the results this gives on X1 for the following specification: reg X2 X1 L.X2 How do...

View Article


Generate R-squares from regressing PCA factors onto variables

Hi everyone, I generated 8 factors using the pca methodology. I want to generate R-squares from regressing each generated factor(f1, f2,..,f8) on the 10 variables. My aim is to finally obtain a...

View Article

Cumulative count of distinct ids by group_id over time periods

Dear Statalist. I am trying to generate a variable that for each org_id cumulatively over time periods counts the number of distinct employee_ids that meet a criterion >= 1. The dataset structure...

View Article


test

Hi Samuel, The data are structured like this: Code: use http://www.stata-press.com/data/r8/stanford, clear gen surgeon=round(runiform()*10) stset stime, failure(died) id(id) stsplit posttran,...

View Article

Construct equally weighted decile portfolios by ranking stocks on beta

I have a dataset of about 1324 companies with weekly returns of the last 16 years. My data looks like this: http://screencast.com/t/fHRRNl08bS What i would like to do is: at the end of each month,...

View Article

GMNL postestimation using margins

Hello, I would like to know how to estimate marginal effetcs after a GMNL model (Fiebig et al., 2010 / Gu et al., 2013), more precisely after a SGMNL model ? The goal of the first model is to estimate...

View Article
Browsing all 65561 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>