Hey there,
I am original a python programmer and must use Stata to access the Data of a research Institute.
So, I have to apologize that my question and Code will read like its written in R or Python.
To my Question, I try to access the mean of a factor (group in stata?)
Agrad = automation potential : Number between 1 and 0 for german classification of labor
AO_Kreis = Working region
My Code snippet works when it’s the simple Case:
mean Agrad if beruf2010_2 == 11 & ao_kreis == 5358
But produces illogical outcomes when I try to stack these conditions onto each other
mean Agrad if beruf2010_2 == 11 & ao_kreis == 5315 | ao_kreis == 5362 | ao_kreis == 5378
The code seems to represent several “OR´s” and not one If and several “OR´s” like I intended.
Best regards
Clemens Schiewek
Related Posts with Combination of If and or Clauses
remove certain string chars if in beginning of string var onlyDear Statalist, I have been searching for ways to remove a sequence of characters from a string var…
Moving average code to moving additive?By using a time-series dataset, I want to create a moving additive index. For example, I need a 5-ye…
cond() functionHi all! I have the following dilemma. I would like to create variables such that: if a local takes…
running a loop n times with different outcome variables and storing the beta, standard error and p valuesHi, STATA people, I have 12000 obs. I want to randomly assign fake treatment within each year with …
A loop to predict a log-modelFor the model, Y= Yt-1+X1t+X2t+X3t+e I want to create a loop to predict future values such that the …
Subscribe to:
Post Comments (Atom)
0 Response to Combination of If and or Clauses
Post a Comment