Stata: selecting the reference variables in an interaction - regression

When I run the following regression,
reg subject inSchool#treatment#male
I get comparisons in reference to inSchool=0, treatment=0, and male=0, but I would like to be able to change the reference variables.
For example I would like to have all the comparisons done in reference to inSchool=1,treatment=0, and male=1.
I have used the following characteristic command but it doesn't seem to have an effect.
char inSchool[omit] 1 male[omit] 1
Am I having a syntax issue or is there no way to choose which variable to omit using #
Thanks in advance!

From help fvvarlist:
You can specify the base level of a factor variable by using the ib. operator.

Related

(Version5) The function 'ta.ema' should be called on each calculation for consistency. It is recommended to extract the call from this scope

thanks for taking the time to read my problem.
I have this warning in my console : The function 'ta.ema' should be called on each calculation for consistency. It is recommended to extract the call from this scope.
So you can see the image of the script I did, I tried different alternative and still have the same warning, also the label.new still doesn't appearenter image description here on my chart.
Thanks for your help !
try to use ta.ema before the beginning of the if loop and store its value in a variable, then use that variable everywhere
you calculate several times the same calculus
and that's not good programming
as said above : "put the ta.ema in a variable" on a level-1 instruction
then use the variable everywhere
so it's less time consuming.

Copying a function from a package in Julia

DISCLAIMER: I am aware that the following is extremely bad practice. I just need a quick-fix for debugging purposes.
I am trying to run a Julia package that is using both JuMP.jl and LightXML.jl.
I get the following error:
WARNING: both JuMP and LightXML export "name"; uses of it in module JEMSS must be qualified
LightXML is added first, so I'd like to make a copy of name, then let JuMP override.
What is the syntax to do this?
The name function consists of:
name(::LightXML.XMLElement)
name(::LightXML.XMLNode)
name(::LightXML.XMLAttr)
Based on the discussion in the comments, I should write that the warning tells you that if you want to use name in your code, you should specify which module's name you want to use. You do this by qualifying it with the module/package name such as LightXML.name or JuMP.name.
If you want to create an alias for, say, LightXML.name, this is also possible.
using LightXML
# make `name2` be an alias for `LightXML.name`
const name2 = LightXML.name # `name2` refers to `LightXML.name` but `LightXML.name` still exists
using JuMP
using JuMP: name # tell the compiler `name` without qualifiers refer to `JuMP.name` so you do not have to qualify it
This actually does not give change the name of LightXML.name but rather create an alias for LightXML.name. After this, you can write name2 instead of LightXML.name or still use LightXML.name as is.
Note that const is an important detail here otherwise whenever you use name2 Julia will have to look it up whether what name2 refers has changed and this will degrade performance.
The other thing to note is that if you want to use name without qualifiers to refer to JuMP.name, you write using JuMP: name to indicate to the compiler which name should be used (since there are still two names). You should, however, do this before using name without any qualifier in your code.
The following therefore will not work.
julia> using LightXML
julia> name # we used `name` here to refer to `LightXML.name `
julia> using JuMP # this will give you the same warning in your question
julia> using JuMP: name # this will give you a warning and be **ignored**
# `name` continues to refer to `LightXML.name` rather than `JuMP.name`

Shows warning during compiling

enter image description here
it show warning
I was suppose to arrange the numbers, In order irrespective of the values, but to move 0 come at last.
To learn what you are doing wrong you need to read a book in C. Basic one.
I can point some errors and good practices.
comparison is done by ==. so you should use if(i==0)
After the second for loop you would want to change the value of i to 0. i=0.
the two for loops should be run upto the point when i<n and j<n.
That if(a[i]==0) comparison is not needed.
You don't need the while loop here.
You can print all of them after the for-for looping.
Global variables are used but you should have a good reason to use that.
Index variables are better if declared and defined locally.
what you are trying to do is known as Bubble sort.
Even after understanding all this and following this you get error try to run it through debugger, try small value of n.
Then if you can't, then ask here.

Warning for variables with function names in Matlab

Sometimes I accidentally declare variables that have the name of a function.
Here is a constructed example:
max(4:5) % 5
max(1:10)=10*ones(10,1); % oops, should be == instead of =
max(4:5) % [10 10]
At the moment I always find this out the hard way and it especially happens with function names that I don't use frequently.
Is there any way to let matlab give a warning about this? It would be ideal to see this on the right hand side of the screen with the other warnings, but I am open to other suggestions.
Since Matlab allows you to overload built-in functionality, you will not receive any warnings when using existing names.
There are, however, a few tricks to minimize the risk of overloading existing functions:
Use explicitFunctionNames. It is much less likely that there is a function maxIndex instead of max.
Use the "Tab"-key often. Matlab will auto-complete functions on the path (as well as variables that you've declared previously). Thus, if the variable auto-completes, it already exists. In case you don't remember whether it's also a function, hit "F1" to see whether there exists a help page for it.
Use functions rather than scripts, so that "mis-"assigned variables in the workspace won't mess up your code.
I'm pretty sure mlint can also check for that.
Generally I would wrap code into functions as much as possible. That way the range of such an override is limited to the scope of the function - so no lasting problems, besides the accidental assumption of course.
When in doubt, check:
exist max
ans =
5
Looking at help exist, you can see that "max" is a function, and shouldn't be assigned as a variable.
>> help exist
exist Check if variables or functions are defined.
exist('A') returns:
0 if A does not exist
1 if A is a variable in the workspace
2 if A is an M-file on MATLAB's search path. It also returns 2 when
A is the full pathname to a file or when A is the name of an
ordinary file on MATLAB's search path
3 if A is a MEX-file on MATLAB's search path
4 if A is a MDL-file on MATLAB's search path
5 if A is a built-in MATLAB function
6 if A is a P-file on MATLAB's search path
7 if A is a directory
8 if A is a class (exist returns 0 for Java classes if you
start MATLAB with the -nojvm option.)

How do I make PhpStorm suggest a list of predefined input variables?

How do I make PhpStorm suggest input variables ?
In Java/C# and the like (with VS/Eclipse), when I have a function that receives enum-input-variable, like:
void func(SomeEnum var);
Whenever I type func(, the editor kindly suggests all the available enums (of type SomeEnum). I look for this same functionality in PHP, when I have a predefined set of input options (like DB's tables).
Maybe with the use of Intellilang or these # tags (PHPDocs ?) I can predefine such list ?
Currently you cannot limit the possible options for code completion in this regard: PHP simply has no such "thing" similar to Enum. The only limitation you can do is limit by expected parameter type (e.g. int variable will not be offered when parameter expects an array).
I think this will be the correct ticket to look for: http://youtrack.jetbrains.com/issue/WI-854 and maybe http://youtrack.jetbrains.com/issue/WI-3623
Kind of related (for array indexes completion): http://youtrack.jetbrains.com/issue/WI-3423