|
|
|
||||
|
|
|||||
For this section we will be using the hs1.sta data set that we worked with in previous sections.
File Open select c:\statistica\hs1.sta Open
This is the one-sample t-test, testing whether the sample of writing scores was drawn from a population with a mean of 50.
Statistics
Basic Statistics/Tables
t-test, single sample
OK
Variables
select write
OK
under "Reference values" select "Test all means against:" and type 50
Summary
This is the two-sample independent t-test with separate (unequal) variances.
Statistics
Basic statistics/Tables
t-test, independent, by groups
OK
Variables
select write as the dependent variable and female as the independent variable
OK
Summary
This is the paired t-test, testing whether or not the mean of write equals the mean of science.
Statistics
Basic Statistics/Tables
t-test, dependent samples
OK
Variables
select write as the first variable and science as the second
OK
Summary
In this example we perform a one-way analysis of variance (ANOVA).
Statistics
Basic Statistics/Tables
Breakdown and one-way ANOVA
OK
under the "Individual tables" tab, click on "Variables"
select write as the dependent variable and prog as the grouping variable
OK
click on "Codes for grouping variables"
All
OK
OK
Analysis of Variance
In this example we perform a two-way analysis of variance (ANOVA). The plot option creates plots of the means, which can be a great visual aid to understanding the data.
Statistics
ANOVA
under "Type of analysis", select "Factorial ANOVA"
and under "Specification method", select "Quick specs dialog"
OK
Variables
select write as the dependent variable and prog and ses
as the categorical predictors
OK
Factor codes
select "All" for both variables
OK
under the "Options" tab, click on "Type III (orthogonal)"
in the "Sums of squares" box
OK
under the "Quick" tab, click on "All effects/graphs"
double-click on prog*ses
OK
The Tukey test is used to test all the pair-wise comparisons of the levels of prog by ses.
under the "Quick" tab, click on "More results" in the bottom left-hand corner under the "Post-hoc" tab, click on "Tukey HSD"
Now we will do an analysis of covariance (ANCOVA). Note that the results are exactly the same as in the regression where write and science are regressed on math.
Statistics
Advanced Linear/Nonlinear Models
General Linear Models
Analysis of covariance
OK
under the "Quick" tab, click on "Variables"
select math as the dependent variable, female as the categorical pred,
and science and write as the continuous pred
OK
under the "Options" tab, click on "Type III (orthogonal)"
in the "Sums of Squares" box
OK
Factor codes
All
OK
All effects
This is plain old OLS regression.
Statistics
Multiple Regression
Variables
select math as the dependent variable and write and science as independent
variables
OK
OK
under "Quick" tab, click on "Summary: Regression results"
It is often very useful to look at the standardized residual versus standardized predicted plot in order to look for outliers and to check for homogeneity of variance. The ideal situation is to see no observations beyond the reference lines, which means that there are no outliers. Also, we would like the points on the plot to be distributed randomly, which means that all the systematic variance has been explained by the model.
Click on the analysis which is minimized in the lower left corner under "Residuals/assumptions/predictions" tab, click on "Perform residual analysis" under "Scatterplots" tab, click on "Predicted vs. residuals"
We will save the unstandardized residuals to a new data set.
under the "Save" tab, click on "Save residuals and predicted" click on "Select All" OK
The P-P plots command produces a normal probability plot. It is a method of testing if the residuals from the regression are normally distributed.
Graphs
2D Graphs
Normal probability plots
under the "Quick" tab, click on "Variables"
select Residuals
OK
in the "Graph type:" box, select "Normal"
OK
The Q-Q plots produces a normal quantile plot. It is another method for testing if the residuals are normally distributed. The normal quantile plot is more sensitive to deviances from normality in the tails of the distribution, whereas the normal probability plot is more sensitive to deviances near the mean of the distribution.
Graphs
2D Graphs
Quantile-Quantile plots
under the "Quick" tab, click on "Variables"
select Residuals
OK
in the "Graph type:" box, select "Normal"
OK
Logistic regression requires a dependent variable that is dichotomous (i.e., has only two values). As we do not have such a variable in our data set, we will create one called honcomp (honors composition). This is purely for illustrative purposes only! First, we need to copy the variable write, and then we will recode the copied variable, which we will call honcomp.
highlight write Vars... Copy... OK
double-click on the new variable and rename it to honcomp and in the box at the bottom, type = write >= 60.
Statistics
Advanced Linear/Nonlinear Models
Generalized Linear/Nonlinear Models
under the "Quick" tab, click on "Logit model"
OK
under the "Quick" tab, click on "Variables"
select honcomp as the dependent variable, and select read and socst as
continuous variables
OK
Response codes
All
OK
OK
under the "Summary" tab, click on "Summary of all effects"
The signrank test is the nonparametric analog of the paired t-test.
Statistics
Nonparametrics
Comparing two dependent samples (variables)
OK
Variables
select write as first variable and read as second variable
OK
Wilcoxon matched pairs test
The Mann Whitney U test is the nonparametric analog of the independent two-sample t-test.
Statistics
Nonparametrics
Comparing two independent samples (groups)
OK
Variables
select write as dependent variable and female as Ind. (grouping) variable
OK
M-W U test
The Kruskal Wallis test is the nonparametric analog of the one-way ANOVA.
Statistics
Nonparametrics
Comparing multiple indep. samples (groups)
OK
Variables
select write as dependent variable and prog as Ind. (grouping) variable
OK
Summary
Note that you will have to scroll to the left in the results to see the output from the Kruskal Wallis test, or you can use the folder system on the left of the output to move to the Kruskal Wallis results.
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services