I want to use the command "strpos" to extract specific observations from a string variable. Im using the command below,
"g newvar = 1 if strpos(var1, "[1]")>0 "
The using variable "var1" looks like below
var1
0 1 2 3
3 4 0 1
I would like to create a variable that takes the value 1 if var1 consists string obs 1. Any help on this would be really appreciated.
Related Posts with Using "strpos" to create new variable
Generating 500 AR(1) processesHello everyone, Just wanted to know how to generate 500 processes of the following model: Yt=alpha…
Is it usual for ivprobit per se to run quickly but margins after that is very slow?ivprobit finished in may a few minutes. But I am waiting for hours for margins to finish. Is this no…
Advice regarding Stata NetCourseHello, Hope you all are well and safe. I am looking to expand my knowledge in visualization using …
Standard Error of Estimation in Panel Data RegressionHello, I am working on a panel data, N=600, T=10. After running the regression analysis, -xtreg, fe-…
Bug in import sasStata Tech Support has verified that there is a bug in version 16.1 import sas. If a SAS dataset (sa…
Subscribe to:
Post Comments (Atom)
0 Response to Using "strpos" to create new variable
Post a Comment