Stata "invalid group specification" error - stata

I'm trying to run a diff-diff analysis of the included dataset (Excel). It is my understanding that the group() specification requires a dummy variable that defines the control group (0) with the treatment group (0). Thus, I have included variable 'treatment' that does just that.
Stata is throwing me this error no matter what I try, and I can't seem to find a fix anywhere to this issue.
Any help would be greatly appreciated!!!
Code:
. didregress (Proposals) (post), group(treated) time(Week)
invalid group specification
None of the groups defined by treated is a control.
r(198);
Image of dataset:
dataset (see treated variable)

Your treatment group should be specified by tvar, not by the group option. Type help didregress for more information: "tvar must be a binary variable indicating observations subject to treatment or a continuous variable measuring treatment intensity".

Related

OpenModelica SimulationOptions 'variableFilter' not working with '^' exceptions

To reduce size of my simulation output files, I want to give variable name exceptions instead of a list of many certain variables to the simulationsOptions/outputFilter (cf. OpenModelica Users Guide / Output) of my model. I found the regexp operator "^" to fullfill my needs, but that didn't work as expected. So I think that something is wrong with the interpretation of connected character strings when negated.
Example:
When I have any derivatives der(...) in my model and use variableFilter=der.* the output file will contain all the filtered derivatives. Since there are no other varibles beginning with character d the same happens with variableFilter=d.*. For testing I also tried variableFilter=rde.* to confirm that every variable is filtered.
When I now try to except by variableFilter=^der.*, =^rde.* or =^d.*, I get exactly the same result as without using ^. So the operator seems to be ignored in this notation.
When I otherwise use variableFilter=[^der].*, =[^rde].* or even =[^d].*, all wanted derivation variables are filtered from the ouput, but there is no difference between those three expressions above. For me it seems that every character is interpretated standalone and not as as a connected string.
Did I understand and use the regexp usage right or could this be a code bug?
Side/follow-up question: Where can I officially report this for software revision?
_
OpenModelica v.1.19.2 (64-bit)

Need answer for this SAS practice question, with explanation if possible

You’re attempting to read a raw data file and you see the following messages displayed in the SAS Log:
NOTE: Invalid data for Salary in line 4 15-23.
RULE: ----|----10---|----20---|----30---|----40---|----50-
4 120104 F 46#30 11MAY1954 33
Employee_Id=120104 employee_gender=F Salary=. birth_date=-2061 _ERROR_=1 _N_=4
NOTE: 20 records were read from the infile ‘c:employees.dat’.
The minimum record length was 33.
The maximum record length was 33.
NOTE: The data set WORK.EMPLOYEES has 20 observations and 4 variables
What does it mean?
A. A compiler error, triggered by an invalid character for the variable Salary.
B. An execution error, triggered by an invalid character for the variable Salary.
C. The 1st of potentially many errors, this one occurring on the 4th observation.
D. An error on the INPUT statement specification for reading the variable Salary.
Looking at the problem:
NOTE: Invalid data for Salary in line 4 15-23.
That is the note you get when you have an input statement from a file or datalines, and you are expecting a numeric value but encounter a nonnumeric value that cannot be read into that field (or otherwise something that doesn't match the expected informat).
D. An error on the INPUT statement specification for reading the variable Salary.
That seems like the best answer to me, depending on how you parse the answer text.
(A) refers to compiler errors, which mean they occur before any data is read in - it's certainly not that, data is where the problem is.
(B) is the other possible answer; it is execution time certainly, and it is indeed caused by an invalid character in the data, but I don't like how that answer is worded and think it's not clear.
(C) is wrong because this is the only error you see...
(D) is the most accurate, I believe, if you assume your data is right anyway. It's possible though that the Input statement is right and your data is bad; in that case it would point to (B) being the right answer.

pylint incorrectly identifies constant name as C0103 not conforming to const-rgx expression

I've been linting my python code for some time now in order to make it more Pythonian and to that effect I've been using pylint to help identify problematic code blocks. However, now I'm having a kind of weird error, where pylint is flagging a correctly formatted constant name as not conforming to the regex provided.
Orginially, the constant was named main, which should match with the regex [a-z\_][a-z0-9\_]{2,30}$, but I got the convention violation message anyway. I tried changing the constant to run_main without any change. I even tried chaning the regex to [\_][a-z0-9\_]{2,30}$|[a-z][\_][a-z0-9\_]{2,30}$but the convention violation persists. I've tried testing the expressions on several regex testing sites to make sure I was not in the wrong. Is it a bug in pylint or am I missing something obvious?
The constant is defined in the following code block:
if __name__ == "__main__":
javabridge.start_vm(class_path=bf.JARS)
run_main = mainInterface()
and the relevant part of my pylintrc file is:
# Naming style matching correct constant names
#const-naming-style=
# Regular expression matching correct constant names. Overrides const-naming-
# style
const-rgx='[\_][a-z0-9\_]{2,30}$|[a-z][\_][a-z0-9\_]{2,30}$'
which yields the following output:
393,4,convention,C0103:Constant name "run_main" doesn't conform to "'[\\_]
[a-z0-9\\_]{2,30}$|[a-z][\\_][a-z0-9\\_]{2,30}$'" pattern ("'[\\_][a-z0-
9\\_]{2,30}$|[a-z][\\_][a-z0-9\\_]{2,30}$'" pattern)
Pylint wants any variable assigned in the outermost scope to be in all uppercase. Calling it MAIN should remove the warning.

ERROR: P does not have a numeric suffix (SAS, RENAME)

After having worked out a bunch of other errors I'm left with the following
ERROR: P does not have a numeric suffix.
From all the info I've been able to find this happens a lot when using PROC TRANSPOSE, however I'm not using that here (and don't anywhere else in this code).
Data Spillover_HE (rename=(F1=FY F2=BN F3=employeeID F4=grade_subject_ID
F5=AsmtID_agg F6=linkB F7=subgroupID F8=w F9=MGP_SE F10=Residual_SE
F11=Residual_Var F12=mgp_var F13=student_n F14=calcID F15=sumwt F16=MGP
F17=ave_prescore F18=p_imp F19=p_postImp F20=p_sped F21=p_sped_rs
F22=p_sped_se_ss F23=p_sped_st F24=p_sped_tt F25=P-ell F26=p_ed
F27=p_hispanic F28=p_black F29=p_white F30=p_asian F31=p_other
F32=p_blahispmale F33=p_overaundcred F34=p_retained F35=p_transfer
F36=p_top10 F37=p_top5 F38=p_top1 F39=p_bot10 F40=p_bot5 F41=p_bot1
F42=target_population F43=mean_residual_var F44=P_0_5)); run;
Obviously I have a bunch of variables that start with "p". None of them are underlined in the log. I'm using SAS Base, and got the same error in SAS Enterprise Guide.
Not sure what my next move should be. Thanks.
A dash is not a correct character in a variable name.
Replace F25=P-ell into F25=P_ell.
You can use dash to specify a range of variables e.g. rename=(x1-x100=y1-y100). This code renames 100 variables with prefix x to y.

Regex expression for grabbing certain keyword and combine them together

I have the following text and i would like to grab the keyword "ATTEMPT TO ACCESS DATABASE" and "was denied", and combine these two together. However, there are some user and path name information in between these two keywords, and this makes it difficult for me to capture the thing i want, as i'm still not yet a regex expert. XD
<182>Mar 27 09:38:55 4.3.2.1 [5439570:00311-46004] 03/11/2015 14:13:05
ATTEMPT TO ACCESS DATABASE mail/abc.nsf by USER was denied
Is there a single regex expression that can help me to fulfill my requirement? Would greatly appreciate for all the help!
Have a look at the following regex:
(ATTEMPT\s+TO\s+ACCESS\s+DATABASE\s+)(\S+)\s+by\s+([\w.-]+)\s+(was\s+denied)
Ouput is:
MATCH 1
1. [71-98] `ATTEMPT TO ACCESS DATABASE `
2. [98-110] `mail/abc.nsf`
3. [114-118] `USER`
4. [119-129] `was denied`
So, you can combine Group 1 and 4 to get ATTEMPT TO ACCESS DATABASE was denied (in any case due to i option), and Group 2 will contain the path name, and Group 3 will hold the user name.