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

total with if condition

Hello! I have a dataset with a number of startups per row. I want to generate the sum of startups that are part of a treatment group. My command is: egen obsTR = total(n_startups_kreis) if treatment !=...

View Article


testing equations

\[ P\left(y_1 = 1| y_2, z\right) = \Phi \left[\frac{z_i\delta +\rho \left(y_{2i}- x_i\pi\right)/\sigma}{\left(1-\rho^2\right)^{1/2}} \right]\]

View Article


renvars command

Hi, I am trying to run the renvars command but it keeps on giving me a particular error. Command: renvars PERSONID yrssch Age inhh, prefix(FATHER) Error: command renvars is unrecognized

View Article

Simulate correlated binary variables

Hi, I would like to simulate correlated binary variables. Theoretically, I should have been able to do the simulation from the following paper https://journals.sagepub.com/doi/pdf...867X1501500118 and...

View Article

Problem with import delimited - characters "¿"...

Hi everyone, I want to import a public data set of standardized tests in Colombia. This information is available as a text file. I tried importing it with the import delimited command, but I encounter...

View Article


Tobit model with two steps

Dear statalisters, I am trying to estimate a generalized tobit model with two steps. The first step is a probit equation which determines whether a firm undertakes R&D or not. HTML Code: y1*=x1*b1...

View Article

Temporary frame

Dear All, if a data frame is created with a temporary name it is disposed of after the end of the program, ok. If it happens to be the current frame when it is disposed of, which frame will become...

View Article

if condition "name global variable == " then enter the...

Hi, I am trying to come up with an "if condition" that would allow me to enter parts of the code if the global variable == a certain name, otherwise ignore part of the code. I have tried the following...

View Article


Merging datasets for specific observations in a variable

Hi, I'm trying to merge two datasets (Disease_reshaped and DevelopmentStage) for only specific observations of a "Disease" variable in the Disease_reshaped dataset. The goal is to create a dataset that...

View Article


Generating unique id across variables

Hello I have data in the following format where each firm is audited by either 1 or two auditors. Code: * Example generated by -dataex-. To install: ssc install dataex clear input str7 firm str1(aud1...

View Article

Identify variables by their order in the dataset

Hi, I am working with a new feed of data every week (in real time). Therefore, as real time passes my time series dataset increase in size and variable names change due to new real dates added...

View Article

Import excel dataset to Stata with MM/DD/YYYY dates as 1st row / variable

Hi, I currently have a dataset that looks like that in Excel: Code: Code: * Example generated by -dataex-. To install: ssc install dataex clear input str8 C str10(D E F G H I J) "DATATYPE" "12/30/2020"...

View Article

PSM (ATET and ATE)

Hi all, I will really appreciate your help on this. I estimated my analysis using the PSM method in stata. I calculated both the Average Treatment Effect (ATE) and the Average Treatment Effect on the...

View Article


Metaprop Forestplot Editing

Hello, I am trying to perform a proportion meta-analysis. The dataset is https://imgur.com/F0Eikiz As suggested in this paper I lauched this command: metaprop num denom, random...

View Article

Merging datasets for specific observations

Hi. The local below comprises of observation values within a variable "Disease". I am to merge two datasets only for the observation values mentioned in the local. However, the code in the loop deletes...

View Article


How to drop the first twelve month of fund returns

Hello all, I am new to the Stata. Can anyone provide any assistance as I need to drop the first twelve month of fund returns in long format where the months that contain no returns data do not count....

View Article

stata bar graph binary variable

Dear All, I am trying to make a graph bar similar to the one attached below (see 'capture'). I have a dummy variable called "religion_dummy" coded 1=jews 2=arabs, and a categorical variable for life...

View Article


Identify the time dimension in unbalanced dataset

Hi there, I'm having an unblanced dataset which look like as the following: id year values 1 2000 123 1 2001 234 1 2002 ..... 1 2003 .... 2 2001 2 2002 2 2003 2 2004 2 2005 3 2000 3 2004 3 2005 3 2008...

View Article

Reghdfe F test on fixed effects function disabled

Hello! ​​​​​A friend of mine and I are now working on a seminar paper, in which we need to replicate the econometric analysis of a published article. We have chosen an article by...

View Article

Generate dummies basded on market share and portfolio shares

Dears I would like to generate a new variables MS & PS as it show in the below: Array I used audit fees as X. According to the previous studies, I generate a dummy variable to measure if an auditor...

View Article
Browsing all 65052 articles
Browse latest View live