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

Find the first occurrence of variable value that follows a specific value in...

Dear all, I am working with a dataset which has 24 float variables named temp1-temp24 (among many other variables). The variables temp1-temp24 have values of 0, 1, 2 or 3 and there is no pattern to...

View Article


State - dependant local projections model

I am running a Local Projections model to try and estimate how household net worth affects the effectiveness of monetary policy. My code for the the LP model is as follows: locproj log_real_gdp,...

View Article


Recoding a variable from panel dataset with duplicate identifiers

Hi everyone. I am currently working on my thesis, covering gender and decision-making in South Africa's National Income Dynamics Study. I wanted some advice on how I can code the decision-making...

View Article

The Impact of exchange rate volatility on trade flows in zambia

hello everyone, I'm trying to estimate exchange rate volatility using the garch(1,1) model for the topic "the impact of exchange rate volatility on trade flows in zambia).The data being used is the...

View Article

Stacked bar charts centered around zero

Hello, I've created the following dataset for the purpose of this question: Code: * Example generated by -dataex-. For more info, type help dataex clear input float(female treatment apple orange banana...

View Article


Can anyone convert this line of code to R?

I'm wondering if anyone knows how to convert this Stata code to R code (for a student of mine). Here is the Stata code, specifying that the data are weighted ("PWEIGHT") and also use successive...

View Article

Insert a text file into a PDF using putpdf?

I regularly teach statistics courses and would like my students to be able to (easily) combine their log file and saved images into one PDF document. I am aware of several third-party commands and apps...

View Article

Export of results to Excel (or in Stata) after running loops in a simulation

Hello! I have a problem with exporting/saving simulation results after every run from Stata to Excel or save them in Stata. I am running a simulation 1000 times and after I code the following: Start of...

View Article


Fill-in missing data based on existing data

Dear all, I'm posting here in desperate search for help. I have an example data set in long format with 5 participants (id=101-105). This is a four-year study that collected data from each participant...

View Article


Remove part of string variable and format variable

Hi. I am trying to do the following with my string variable: 1. remove the "-" and everything before it in my string variable. So "HEI-GMRV" will be "GMRV" 2. remove all lead and lag spaces in what is...

View Article

Multiple imputation no convergence

Dear all, There were some questions about non convergence with mlogit in this forum. Strangely, I am having this non convergenence problem with logit in the imputation model. No matter what variables I...

View Article

ivreg2 help with endogeneity concern

I have panel data of 25 countries and 20 years. I am implementing ivreg2, gmm2s command to apply IV-GMM in my analysis. I want to know how conflict across countries affects trade. I use some policy and...

View Article

Add Columns "Total" and "Frequency" for...

Hi, I have the next table made with collect table: collect table priority1 priority2, statistic(proportion, across(priority2)) total(priority1) nformat(%6.3f) // nototal collect label levels priority1...

View Article


Placing dates/time values into same row: code assistant

Dear Stata users, For the example dataset below, I would like to move the examdatetime values for a specific patient when the event_type is 2, so that they appear in the same row as when their...

View Article

Stacked bar with multiple variables having same value labels

Hi everyone, The figure below shows the reading behaviour of respondents when they signing up for credit card (see picture below). I use the following code to generate the picture. graph hbar,...

View Article


Stacked bar graph for >1 categorical vars

Hi, I am trying to do something seemingly basic but surprisingly complicated - to plot the levels of multiple categorical variables as stacked bars in a single graph. The purpose is to depict the...

View Article

Reshape data to long by month-year using data collection date range

Hi! I am having trouble reshaping my data to long by month-year for each month-year an observation is in my dataset and hoping this forum can help. Currently the data are long, but by round. Each round...

View Article


Setting up Stata Automation in Windows 11

I am setting up Stata (18.5, parallel edition) on a Windows 11 machine using the Stata Automation library as described at: https://www.stata.com/automation/. I am able to successfully install a Stata...

View Article

Why STATA software does not have modern unit root test for time series?

Dear STATAlist community, I am wondering why stata software does not have modern unit root test for time series. it only can implement ADF, PP, or GSL-DF. Does anyone know if there is modern unit root...

View Article

Why STATA software does not have modern unit root test for time series?

Dear STATAlist community, I am wondering why stata software does not have modern unit root test for time series. It only can implement ADF, PP, or GSL-DF. Does anyone know if there are modern unit root...

View Article
Browsing all 73374 articles
Browse latest View live


Latest Images

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