Lecture5
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
(e.g. scatter plots)
▪ tests hypotheses
Example:
proc reg data=mydata; model weight = height age; run;
proc reg
Syntax: proc reg <options>;
model response = effects </options>; plot yvariable*xvariable = ’symbol’; by varlist; output <OUT=SAS data set>
calculate predicted values evaluate the fit or lack of fit of a model test hypotheses
design outcome
The linear model
y 0 1x1 2x2 k xk ~ N (0, 2 )
U95. upper 95% CI bound for individual prediction
L95M. lower 95% CI bound for mean of dependent variable
U95M. upper 95% CI bound for mean of dependent variable
Example:
plot weight * age / pred; plot r. * p. / vref = 0;
pro源自文库 reg
some statistics available for plotting:
P.
predicted values
R.
residuals
L95. lower 95% CI bound for individual prediction
SAS Lecture 5 – Some regression procedures
Aidan McDermott, April 17, 2007
What will the output from this program look like? How many variables will be in the dataset example, and what will be the length and type of each variable? What will the variable package look like?
can specify several plots optional symbol to mark points yvariable and xvariable can be variables
specified in model statements or statistics available in output statement
Example:
Weight 0 1Height 2 Age
Note: outcome variable must be continuous and normal given independent variables
the linear model with proc reg
▪ estimates parameters by least squares ▪ produces diagnostics to test model fit
creates SAS data set all original variables included keyword=names specifies the statistics to
include
Example:
output out=pvals p=pred r=resid;
Example: NMES
What will the output from this program look like?
Modeling with SAS
examine relationships between variables
estimate parameters and their standard errors
proc reg
the model statement
model response=<effects></options>;
required variables must be numeric many options can specify more than one model
statement
<output statistic list>; run;
proc reg
proc reg statement syntax:
data = SAS data set name input data set outest = SAS data set name creates data set with parameter estimates simple prints simple statistics
Example:
plot weight * age / pred; plot r. * p. / vref = 0; plot (weight p. l95. U95.) * age / overlay;
proc reg
the output statement
output <OUT=SAS data set> keywords=names;
Example:
model weight = height age; model weight = height age / p clm cli;
proc reg
the plot statement
plot yvariable*xvariable <=symbol> </options>;
produces scatter plots - yvariable on the vertical axis and xvariable on the horizontal axis
▪ tests hypotheses
Example:
proc reg data=mydata; model weight = height age; run;
proc reg
Syntax: proc reg <options>;
model response = effects </options>; plot yvariable*xvariable = ’symbol’; by varlist; output <OUT=SAS data set>
calculate predicted values evaluate the fit or lack of fit of a model test hypotheses
design outcome
The linear model
y 0 1x1 2x2 k xk ~ N (0, 2 )
U95. upper 95% CI bound for individual prediction
L95M. lower 95% CI bound for mean of dependent variable
U95M. upper 95% CI bound for mean of dependent variable
Example:
plot weight * age / pred; plot r. * p. / vref = 0;
pro源自文库 reg
some statistics available for plotting:
P.
predicted values
R.
residuals
L95. lower 95% CI bound for individual prediction
SAS Lecture 5 – Some regression procedures
Aidan McDermott, April 17, 2007
What will the output from this program look like? How many variables will be in the dataset example, and what will be the length and type of each variable? What will the variable package look like?
can specify several plots optional symbol to mark points yvariable and xvariable can be variables
specified in model statements or statistics available in output statement
Example:
Weight 0 1Height 2 Age
Note: outcome variable must be continuous and normal given independent variables
the linear model with proc reg
▪ estimates parameters by least squares ▪ produces diagnostics to test model fit
creates SAS data set all original variables included keyword=names specifies the statistics to
include
Example:
output out=pvals p=pred r=resid;
Example: NMES
What will the output from this program look like?
Modeling with SAS
examine relationships between variables
estimate parameters and their standard errors
proc reg
the model statement
model response=<effects></options>;
required variables must be numeric many options can specify more than one model
statement
<output statistic list>; run;
proc reg
proc reg statement syntax:
data = SAS data set name input data set outest = SAS data set name creates data set with parameter estimates simple prints simple statistics
Example:
plot weight * age / pred; plot r. * p. / vref = 0; plot (weight p. l95. U95.) * age / overlay;
proc reg
the output statement
output <OUT=SAS data set> keywords=names;
Example:
model weight = height age; model weight = height age / p clm cli;
proc reg
the plot statement
plot yvariable*xvariable <=symbol> </options>;
produces scatter plots - yvariable on the vertical axis and xvariable on the horizontal axis