Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
-2 votes
1 answer
100 views

I am trying to create a loop in Stata so that I can add multiple variables for creating mean_var and median_var. However, this data isn't creating any variables; the collapsed_file is the same as my ...
0 votes
1 answer
75 views

I created this code that works correctly in Stata 17, but when I try to replicate and run it in Stata 16, it produces errors. The main issue is that it only generates the table considering the first ...
0 votes
1 answer
81 views

In a Stata program, I'm trying to get a variable name, modify it using regexr(oldvarname, "some_regex", "replacement"), store it in a new local local newvarname, and use that ...
vinceroni's user avatar
  • 117
0 votes
1 answer
242 views

Using Stata v18. I just want to tab all variables in the local varlist (in my original data, it's to display "missed" ER variables, but otherwise no difference). Any ideas on why Stata keeps ...
1 vote
2 answers
430 views

In Stata I am looping over i and inside the loop, I want to get i-1. This is what I tried: forvalues i = 2/10{ local j `i' - 1 drop if view`j' = 0 } However, the j is actually 2-1 instead of ...
Wendy's user avatar
  • 47
0 votes
1 answer
131 views

I have a dataset named 'vhlss' that uses a certain font. Somehow, when I import it into Stata, the text appears like this. Even though I've adjusted the font settings in Stata, and it's Stata 18. I ...
1 vote
1 answer
48 views

I'm working on a program in Stata that requires the weighted percentile (I'm inclined to have the user set up first svyset instead of allowing them pass the weight variable in my command), and I need ...
0 votes
1 answer
52 views

I want to shorten the following code. How do I go about it? In essence, I would like to create another global called total_wardlist that would have the global macros mentioned below: i.e. wardlist_01, ...
0 votes
1 answer
114 views

I am tabulating in Stata the weighted frequency of three variables (EVR_CIGS, P12M_CIGS, CUR_CIGS), and I am using the estout package to have my weighted results in Excel. I need to print the ...
0 votes
1 answer
93 views

I am using a Python package that allows me to integrate data retrieved in Python to be transferred to Stata. As I am doing this across 190 countries, it takes a long time to retrieve multiple ...
0 votes
1 answer
555 views

I have this graph in Stata 14: wrong chart built with this data: data columns I used two commands to generate the last two variables to build the graph I want: // Command 1 gen mayores_65=0 if Edad>...
1 vote
1 answer
126 views

I am trying to write a Stata program that passes a local to a Python function. It is based on this example, where this approach works. Here is a toy example demonstrating the problem: python clear ...
dimitriy's user avatar
  • 9,460
0 votes
1 answer
583 views

I am trying to loop over a different set of control variables. I run the below code but get an error { required. Any help would be appreciated. local tmax "tmax_3 tmax_2 tmax_1 tmax0 tmax1 tmax2 ...
0 votes
1 answer
104 views

I have a meglm statement with multiple binomial outcomes and I am trying to put it in a foreach loop but whenever I run this code, it gives me the error message "factor-variable operators not ...
-1 votes
1 answer
70 views

I have a dataset that looks like the following: year Gender VP 2023 Total 3 2023 F 2 2023 M ...
Shubhi's user avatar
  • 27

15 30 50 per page
1
2 3 4 5
...
12

AltStyle によって変換されたページ (->オリジナル) /