All commands
# |
content
|
1 [+]
|
capt
program drop _all
All properties
key |
content |
command |
capt |
indent |
0 |
parameters |
program drop _all |
|
2 [+]
|
mata:
mata
clear
All properties
key |
content |
command |
mata |
indent |
0 |
parameters |
clear |
prefix |
mata: |
|
4 [+]
|
type
flipmat.ado
All properties
key |
content |
command |
type |
indent |
0 |
parameters |
flipmat.ado |
|
16 [+]
|
do
mf_flipmat.mata
All properties
key |
content |
command |
do |
indent |
0 |
parameters |
mf_flipmat.mata |
|
18 [+]
|
type
mf_flipmat.mata
All properties
key |
content |
command |
type |
indent |
0 |
parameters |
mf_flipmat.mata |
|
|
|
22 [+]
|
mata
-
mata:
void function mf_flipmat(string scalar name, string scalar horiz)
{
X = st_matrix(name)
rs = st_matrixrowstripe(name)
cs = st_matrixcolstripe(name)
if (horiz == "") {
X = (rows(X)>1 ? X[rows(X)..1, .]: X)
rs = (rows(rs)>1 ? rs[rows(rs)..1, .]: rs)
}
else {
X = (cols(X)>1 ? X[., cols(X)..1]: X)
cs = (rows(cs)>1 ? cs[rows(cs)..1, .]: cs)
}
st_matrix(name, X)
st_matrixcolstripe(name, cs)
st_matrixrowstripe(name, rs)
}
end
All properties
key |
content |
command |
mata |
comment |
block (19 lines) |
|
43 [+]
|
clear
All properties
key |
content |
command |
clear |
indent |
0 |
parameters |
|
|
44 [+]
|
set
obs 25
All properties
key |
content |
command |
set |
indent |
0 |
parameters |
obs 25 |
|
45 [+]
|
set
seed 20071110
All properties
key |
content |
command |
set |
indent |
0 |
parameters |
seed 20071110 |
|
46 [+]
|
g
id = int(1000*uniform())
|
47 [+]
|
g
hw = int(50*uniform()+5)
|
48 [+]
|
g
mt = int(2*hw + 5*invnorm(uniform()))
|
49 [+]
|
g
final = int(4*hw + 7*invnorm(uniform()))
|
50 [+]
|
g
total = hw + mt + final
All properties
key |
content |
command |
g |
indent |
0 |
parameters |
total = hw + mt + final |
|
51 [+]
|
sort
total
All properties
key |
content |
command |
sort |
indent |
0 |
parameters |
total |
|
52 [+]
|
su
All properties
key |
content |
command |
su |
indent |
0 |
parameters |
|
|
53 [+]
|
mkmat
hw mt final total
, mat(grades)
|
54 [+]
|
mkmat
id
, mat(id)
All properties
key |
content |
command |
mkmat |
indent |
0 |
options |
mat(id) |
parameters |
id |
|
55 [+]
|
forv
i=1/25 {
All properties
key |
content |
command |
forv |
indent |
0 |
parameters |
i=1/25 { |
|
56 [+]
|
local
id = string(id[`i',1])
All properties
key |
content |
command |
local |
indent |
1 |
parameters |
id = string(id[`i',1]) |
|
57 [+]
|
local
idnr "`idnr' `id'"
All properties
key |
content |
command |
local |
indent |
1 |
parameters |
idnr "`idnr' `id'" |
|
58 [+]
|
}
All properties
key |
content |
command |
} |
indent |
0 |
parameters |
|
|
59 [+]
|
mat
rownames grades = `idnr'
All properties
key |
content |
command |
mat |
indent |
0 |
parameters |
rownames grades = `idnr' |
|
62 [+]
|
use
course
, clear
All properties
key |
content |
command |
use |
indent |
0 |
options |
clear |
parameters |
course |
|
63 [+]
|
mat
list grades
, noheader
|
65 [+]
|
flipmat
grades
All properties
key |
content |
command |
flipmat |
indent |
0 |
parameters |
grades |
|
66 [+]
|
mat
list grades
, noheader
|
68 [+]
|
flipmat
grades
, horiz
All properties
key |
content |
command |
flipmat |
indent |
0 |
options |
horiz |
parameters |
grades |
|
69 [+]
|
mat
list grades
, noheader
|