### Stat test on between-group variance

proc glimmix data=temp2 /*Method=RSPL*/ ;
class  CAMPUS;
random int / subject = CAMPUS_14;
covtest /wald;
output out=gmxout_alglog residual=resid;
RUN;

### Numeric <--> String Conversion

```/* convert numeric to character */
char_year=put(year,4.0);

/* convert character to numeric */
char1='1234.56';
num1=input(char,7.);
```

### Keep variables when they have the same prefix

I want to keep variables when they start from SUM_*.  Could you advise?

You can use the colon modifier to do this.  I have include sample code below.

data sums;

set these2;

keep subgroup

sum_:;

run;

### Excel function for statistical significance

=IF(ABS(\$G3)<0.001,"***",IF(ABS(\$G3)<0.01,"**",IF(ABS(\$G3)<0.05,"*",IF(ABS(\$G3)<0.1,"",IF(ABS(\$G3)>=0.1,"")))))

### Creating a sequence variable by subgroup

data indiv4;
set indiv3;
if N_entry > 9;
run;
proc sort;by subgroup;
run;

data indiv5;
retain sequence;
set indiv4;
by subgroup;
if first.subgroup then sequence=0;
sequence=sequence+1;
run;

### first. and last.

http://www.albany.edu/~msz03/epi514/notes/first_last.pdf

data indiv4;
set indiv3;
if N_entry > 9;
run;
proc sort;by subgroup;
run;

data indiv5;
set indiv4;
by subgroup;

first_id=first.subgroup;
last_id=last.subgroup;

run;

Variance Almanac