Hello all,
apologies if this is a silly Q but I am a very newbie in Stata and just learning it!
I wish to use the following commands :
gen month=month(date)
gen year=year(date
gen order_month=01 if month==03 & year==2016
replace order_month=02 if month==04 & year==2016
replace order_month=03 if month==05 & year==2016
I've used the: gen month=month(date) & gen year=year(date) to generate the month and year but when I am trying to use the rest ones I get an error R(109) saying :
" In an expression, you attempted to combine a string and numeric
subexpression in a logically impossible way. For instance, you
attempted to subtract a string from a number or you attempted
to take the substring of a number."
the month variable is a str2 type and the year str4 type if that helps.
I don't know what I am doing wrong and how to resolve it.
Apologies again if this is a silly Q. If anyone wishes to spend some time and help me I really appreciate it.
thank you,
Maria
Related Posts with R (109) error code
Store Regression Coefficients after LoopDear all, I have the following data format where type is the type of the car (categorical). At each…
Multinomial Probit model with continuous endogenous regressorsHi there May I ask if there are stata commands for running multinomial probit model with continuous…
Cointegration for Probit modelGood evening, I have a probit model where: probit(y) = intercept + beta1*var1 + beta2*var2 + beta3…
Ordered logistic regression where both dependent and independent variables are ordinalDear Stata society, I am currently analysing the impact of Covid19 on health professionals work, th…
How to overcome the maximum (300) limits of estimation results in storageI have a dataset of nearly 1000 individuals, each individuals have 1200-1300 obs. The task is run re…
Subscribe to:
Post Comments (Atom)
0 Response to R (109) error code
Post a Comment