-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTCOEF.MAC
87 lines (79 loc) · 2.27 KB
/
STCOEF.MAC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
macro
###################################################################
#
# STCOEF.MAC
#
# Cathy Akritas
# 06/27/2002
#
# This macro calculates the standardized coefficients for simple and
# multiple regression analysis.
#
# First enter your data into your worksheet. Suppose your Y variable is
# in C1 and your independent variables are in C2, C3, and C4.
#
# Choose Command Line Editor from the Edit menu. Type the command
#
# %STCOEF C1 C2 C3 C4
#
# Click on 'Submit Commands'.
#
# The first column is always used as the dependent variable, Y and the
# other columns are used as the independent variables X1, X2, X3... You
# must list at least 1 independent variable. The maximum number of
# independent variables is limited by n = (number of rows of data in the
# dataset).
#
# The maximum number of independent variables is limited to (n-2).
#
# If you want to store the standardized coefficients in the worksheet,
# use the optional subcommand STORE Cx, where Cx is an empty column in
# your worksheet. For example, Command Line Editor from the Edit menu.
# Type the command:
#
# %STCOEF C1 C2 C3 C4;
# STORE C10.
#
# Click on 'Submit Commands'.
#
# The standardized coefficients from regressing c1 on c2 c3 and c4 will
# be stored in C10.
#
###########################################################################
#
# Neither Minitab, Inc. nor the author(s) of this MACRO makes any claim
# of or offers any Warranty whatsoever with regard to the accuracy of
# this MACRO or its suitability for use. Minitab, Inc. and the author(s)
# of this MACRO each hereby disclaims any Warranty and/or liability with
# respect thereto.
#
###########################################################################
STCOEF y x.1-x.n;
STORE StdBeta.
mcolumn y x.1-x.n StdCoef Names StdBeta betas title
mconstant n i j nme ynme ttl1 ttl2 ttl3
mreset
noecho
brief 0
notitle
regress y n x.1-x.n;
coefficients betas.
kkname ynme y
kkset ttl1 "Standardized Regression Coefficients for "
kkcat ttl1 ynme ttl2
copy ttl2 title
do i = 1:n
let j = 1+i
let StdCoef(i) = betas(j)*(stdev(X.i)/stdev(y))
kkname nme x.i
stack Names nme Names
enddo
Name Names 'Predictors'
brief 2
note
note
mtitle ttl2
#write title
Print Names StdCoef
copy StdCoef StdBeta
endmacro