필터 지우기
필터 지우기

Use of Anovan parameter 'continuous'?

조회 수: 5 (최근 30일)
Jerry Gregoire
Jerry Gregoire 2012년 7월 18일
편집: Adam Danz 2020년 5월 19일
The documentation for the parameter 'continuous' for anovan is scant. I have three factors, two are numeric: 'P','F', and one is categorical: 'W'. I assume that if I run an anova I should specify the numeric values. I see that if I don't I get radically different answers. Here is how I am calling it. Is it correct? I nominalized the categorical factor.
anovan(ds.R, [ds.Power ds.Freq double(nominal(ds.Waveform))], 'varnames', {'P' 'F' 'W'}, 'continuous', [1 2]);
Also, why is it so different? Anova w/o continuous (only main effects shown for brevity)
Source Sum Sq. d.f. Mean Sq. F Prob>F
----------------------------------------------------
P 5.463 1 5.4626 2.72 0.1027
F 7.114 1 7.1141 3.54 0.0631
W 0.312 1 0.3116 0.16 0.6946
Anova with continuous
P 22.821 1 22.8214 11.36 0.0011
F 10.206 1 10.2057 5.08 0.0267
W 5.732 1 5.7319 2.85 0.0947

답변 (2개)

Matthew
Matthew 2013년 10월 18일
Jerry, you are right in that there is very little documentation of the ANOVAN function. I have similar questions around ANOVAN with continuous variables. In your specific case, getting different results might make sense depending on how the continuous data look.
Another related question:
Why does the ANOVA table produced by calling: anovan(y,{g_cat x},'model','full','continuous',[2])
differ from what is given by: aoctool(x,y,g_cat)
where x is a continuous variable (time, with three possible values 3, 6, 12 months) y is a measure of response g is a cell array full of either '1' or '2' for two different treatment groups.
I would have thought that these two models would be identical, but the results differ (calculated sum of squares are different, cannot be made to match when varying the sstype option). Better documentation of both functions would help a lot!

Adam Danz
Adam Danz 2019년 4월 23일
편집: Adam Danz 2020년 5월 3일
"The documentation for the parameter 'continuous' for anovan is scant. I have three factors, two are numeric: 'P','F', and one is categorical: 'W'. I assume that if I run an anova I should specify the numeric values."
What matters is if they are continuous or categorical. For example, the first row below is continuous while the second row is categorical (although it's class is double). You should specify the continuous values.
F = [1.1 0.01 1.85 2.01 -0.12 -0.04];
W = [0 0 0 1 1 1 ];
% or categorical([0 0 0 1 1 1 ]);
"Why are my results different when I use a continuous variable?" [rephrased]
The anovan() function performs an n-way analysis of variance. When at least one of the grouping variables are labeled as continuous, the anovan() function peforms an ANCOVA instead (Matlab refers to it as an ANOCOVA, same thing). The ANCOVA considers covariance and an ANOVA does not.
This example here in the documentation demonstrates how anovan() is used to perform and ANCOVA.
  댓글 수: 1
John TS
John TS 2020년 5월 3일
Also had a similar problem---- Matlab and SPSS agree in results when you use fixed FACTORS. As soon as you change 1 factor in Matlab to be 'Continuous'...the results are different! with MAtlab saying 1 degree of freedom for a factor that has 3 levels e.g. 5, 10 and 15 ...Someone to explain?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Analysis of Variance and Covariance에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by