Hello,
I am created a local variable `tif' which loops over around 45 terms (string).
local tif "0"
foreach var of varlist item101-item145 {
local iic "(1.7*`var'a)^2*(1/(1+exp(-1.7*`var'a*(x-`var'b))))*(1-(1/(1+exp(-1.7*`var'a*(x-`var'b)))))"
local tif "`tif'+ `iic "
}
This `tif' is a mathematical expression in terms of x. I then code:
twoway (function `tif', range(-5 5))
All these run fine. However the moment I add another term in the loop say item146, I get an error : "error in expression"
error in expression: 0+ (1.7*item101a)^2*(1/(1+exp(-1.7*item101a*(x-item101b))))*(1-(1/(1
> +exp(-1.7*item101a*(x-item101b)))))..........
Is this because the function has increased its maximum length? I am not sure what the problem is.
Related Posts with Error in expression
How to deal with missings on partner information if the person has no partner?Dear all, I use panel / survey data and in my estimations I include variables like "age of partner"…
install ado filesHello, I am trying to install some ado files which I downloaded from a website in my stata. I read …
stationarity of explanatory variables in time series regressionsI'm finding myself confused and unable to find good answers to what seems to be a simple question: …
Generate a count variable capturing # of times a value occurs in categorical variablesDear Stata users, I have a panel data set with 14 string variables each of which indicates whether …
Significance levels in StataHello, I have a question on how Stata calculates significance levels. When I get a P-value of 0.00…
Subscribe to:
Post Comments (Atom)
0 Response to Error in expression
Post a Comment