diff --git a/toolbox/datasets/multivariate/cinema.mat b/toolbox/datasets/multivariate/cinema.mat index 893c58dd6..c0136a650 100644 Binary files a/toolbox/datasets/multivariate/cinema.mat and b/toolbox/datasets/multivariate/cinema.mat differ diff --git a/toolbox/graphics/balloonplot.m b/toolbox/graphics/balloonplot.m index 7572b0558..1009958b8 100644 --- a/toolbox/graphics/balloonplot.m +++ b/toolbox/graphics/balloonplot.m @@ -186,8 +186,8 @@ colslab={'Wife' 'Alternating' 'Husband' 'Jointly'}; % If the DimensionNames is set the xlabel and ylabel will be added % automatically. - Ntable.Properties.DimensionNames=["Repartition in the couple" "13 housetasks"]; Ntable=array2table(N,'VariableNames',colslab,'RowNames',rowslab); + Ntable.Properties.DimensionNames=["Repartition in the couple" "13 housetasks"]; % Call to balloonplot with option 'contrib2Index' boolean equal to % true. In this case the contributions to the Chi2 statistic % are shown. The color is associated to the sign. @@ -199,7 +199,7 @@ %% Example of ballonplot with option contrib2Index as a matrix. load SportHealth.mat out=corrOrdinal(SportHealth); - balloonplot(SportHealth,'contrib2Index',out.IndCont2CminusD) + balloonplot(SportHealth,'contrib2Index',out.Contrib2CminusD) %} %% Beginning of code diff --git a/toolbox/helpfiles/FSDA/corrOrdinal.html b/toolbox/helpfiles/FSDA/corrOrdinal.html index bd581ba3e..5158098ee 100644 --- a/toolbox/helpfiles/FSDA/corrOrdinal.html +++ b/toolbox/helpfiles/FSDA/corrOrdinal.html @@ -38,26 +38,26 @@ % zero, this indicates a strong positive association between the % written and the oral examination.
Test of H_0: independence between rows and columns
 The standard errors are computed under H_0
-             Coeff     se     zscore    pval
-             _____    ____    ______    ____
+              Coeff        se       zscore       pval   
+             _______    ________    ______    __________
 
-    gamma    0.50     0.10     5.09     0.00
-    taua     0.18     0.05     3.86     0.00
-    taub     0.31     0.06     5.09     0.00
-    tauc     0.27     0.05     5.09     0.00
-    dyx      0.31     0.06     5.09     0.00
+    gamma        0.5    0.098239    5.0896     3.588e-07
+    taua     0.18342    0.047553    3.8571    0.00011474
+    taub     0.30557    0.060038    5.0896     3.588e-07
+    tauc     0.27375    0.053786    5.0896     3.588e-07
+    dyx      0.31466    0.061823    5.0896     3.588e-07
 
 -----------------------------------------
 Indexes and 95% confidence limits
 The standard error are computed under H_1
-             Value    StandardError    ConflimL    ConflimU
-             _____    _____________    ________    ________
+              Value     StandardError    ConflimL    ConflimU
+             _______    _____________    ________    ________
 
-    gamma    0.50         0.09           0.33        0.67  
-    taua     0.18         0.01           0.16        0.21  
-    taub     0.31         0.06           0.19        0.42  
-    tauc     0.27         0.05           0.17        0.38  
-    dyx      0.31         0.06           0.20        0.43  
+    gamma        0.5        0.0876       0.32831     0.67169 
+    taua     0.18342      0.011904       0.16009     0.20675 
+    taub     0.30557       0.05852       0.19087     0.42027 
+    tauc     0.27375      0.053786       0.16833     0.37917 
+    dyx      0.31466      0.059899       0.19726     0.43205 
 
 

  • Compare calculation of tau-b with that which comes from Matlab function corr.
  • % Starting from a contingency table, create the original data matrix to
    @@ -119,41 +119,41 @@
     % It is clear the positive relationship between 
     % 'Self-Reported Health' and 'Exercise Frequency'
    Test of H_0: independence between rows and columns
     The standard errors are computed under H_0
    -             Coeff     se     zscore    pval
    -             _____    ____    ______    ____
    +              Coeff        se       zscore    pval
    +             _______    ________    ______    ____
     
    -    gamma    0.59     0.05    11.19     0.00
    -    taua     0.34     0.04     8.82     0.00
    -    taub     0.46     0.04    11.19     0.00
    -    tauc     0.45     0.04    11.19     0.00
    -    dyx      0.45     0.04    11.19     0.00
    +    gamma    0.59385    0.053088    11.186     0  
    +    taua     0.33958     0.03852    8.8157     0  
    +    taub     0.45635    0.040796    11.186     0  
    +    tauc     0.45128    0.040343    11.186     0  
    +    dyx       0.4525    0.040451    11.186     0  
     
     -----------------------------------------
     Indexes and 95% confidence limits
     The standard error are computed under H_1
    -             Value    StandardError    ConflimL    ConflimU
    -             _____    _____________    ________    ________
    +              Value     StandardError    ConflimL    ConflimU
    +             _______    _____________    ________    ________
     
    -    gamma    0.59         0.05           0.50        0.69  
    -    taua     0.34         0.01           0.32        0.36  
    -    taub     0.46         0.04           0.38        0.54  
    -    tauc     0.45         0.04           0.37        0.53  
    -    dyx      0.45         0.04           0.37        0.53  
    +    gamma    0.59385       0.04837       0.49905     0.68866 
    +    taua     0.33958      0.011291       0.31745     0.36171 
    +    taub     0.45635      0.040331        0.3773      0.5354 
    +    tauc     0.45128      0.040343       0.37221     0.53036 
    +    dyx       0.4525      0.040106       0.37389     0.53111 
     
     
    Click here for the graphical output of this example (link to Ro.S.A. website)

  • Example 2 of use of option plots.
  • - Opinion on the movied watched and age interval

    load cinema.mat
    +     Opinion on the movie watched and age interval
    
    load cinema.mat
     out=corrOrdinal(cinema,'plots',true);
     % It is clear the negative relationship between 
     % age and satisfaction towards the watched movie
    Test of H_0: independence between rows and columns
     The standard errors are computed under H_0
    -             Coeff     se     zscore    pval
    -             _____    ____    ______    ____
    +              Coeff         se       zscore        pval   
    +             ________    ________    _______    __________
     
    -    gamma    -0.22    0.03    -6.60     0.00
    -    taua     -0.11    0.02    -6.01     0.00
    -    taub     -0.16    0.02    -6.60     0.00
    -    tauc     -0.15    0.02    -6.60     0.00
    -    dyx      -0.13    0.02    -6.60     0.00
    +    gamma    -0.22239    0.033693    -6.6004    4.0994e-11
    +    taua     -0.10884    0.018121    -6.0064    1.8967e-09
    +    taub     -0.15598    0.023632    -6.6004    4.0994e-11
    +    tauc     -0.14501     0.02197    -6.6004    4.0994e-11
    +    dyx      -0.12946    0.019614    -6.6004    4.0994e-11
     
     -----------------------------------------
     Indexes and 95% confidence limits
    @@ -161,11 +161,11 @@
                  Value    StandardError    ConflimL    ConflimU
                  _____    _____________    ________    ________
     
    -    gamma    0.00         0.03           0.00        0.00  
    -    taua     0.00         0.00           0.00        0.00  
    -    taub     0.00         0.02           0.00        0.00  
    -    tauc     0.00         0.02           0.00        0.00  
    -    dyx      0.00         0.02           0.00        0.00  
    +    gamma      0         0.033312         0           0    
    +    taua       0        0.0035492         0           0    
    +    taub       0         0.023518         0           0    
    +    tauc       0          0.02197         0           0    
    +    dyx        0         0.019609         0           0    
     
     Warning: Ignoring extra legend entries. 
     
    Click here for the graphical output of this example (link to Ro.S.A. website)

    Input Arguments

    expand all

    N — Contingency table (default) or n-by-2 input dataset. Matrix or Table.

    Matrix or table which contains the input contingency @@ -249,10 +249,10 @@ standard errors (second column), lower confidence limit (third column), upper confidence limit (fourth column).

    Note that the standard errors in this table are computed not - assuming the null hypothesis of independence.

    IndContr2CminusD

    IxJ array containing individual contributions to - the commpon numerator of all the indexes above (namely - C-D).

    IndContr2CminusDtable

    IxJ table containing individual contributions to - the commpon numerator of all the indexes above (namely + assuming the null hypothesis of independence.

    Contrib2CminusD

    IxJ array containing individual contributions to + the common numerator of all the indexes above (namely + C-D).

    Contrib2CminusDtable

    IxJ table containing individual contributions to + the common numerator of all the indexes above (namely C-D).

    More About

    expand all

    Additional Details

    All these indexes are based on concordant and discordant pairs.

    @@ -260,9 +260,9 @@ variable also is higher on the other variable, and a pair of observations is discordant if the subject who is higher on one variable is lower on the other variable.

    - More formally, a pair (i,j), i=1, 2, ..., n is concordant if - (x(i)-x(j)) $\times$ (y(i)-y(j))>0.

    - It is discordant if (x(i)-x(j) ) $\times$ (y(i)-y(j))<0 + More formally, a pair $(i,j)$, $i=1, 2, ..., n$ is concordant if + $(x(i)-x(j)) \times (y(i)-y(j))>0$.

    + It is discordant if $(x(i)-x(j) ) \times (y(i)-y(j))<0$.

    Let $C$ be the total number of concordant pairs (concordances) and $D$ the total number of discordant pairs (discordances) . If $C > D$ the variables have a positive association, but if $C < D$ then the variables diff --git a/toolbox/helpfiles/FSDA/datasets_mv.html b/toolbox/helpfiles/FSDA/datasets_mv.html index f3a087995..835bad8a0 100644 --- a/toolbox/helpfiles/FSDA/datasets_mv.html +++ b/toolbox/helpfiles/FSDA/datasets_mv.html @@ -211,6 +211,50 @@

    Data matrices

    - enterpreneous and skilled self-employed among those of working age. + + fat + Phisical measurements of 251 males. The variables + are
    +
    + - + body_fat: Percent body fat using Brozek's equation, 457/Density - 414.2
    + - +body_fat_siri: Percent body fat using Siri's equation, 495/Density - 450
    + - +density: Density (gm/cm^2)
    + - + age: Age (yrs)
    + - +weight: Weight (lbs)
    + - +height: Height (inches)
    + - +BMI: Adiposity index = Weight/Height^2 (kg/m^2)
    + - ffweight: Fat Free Weight = (1 - fraction of body fat) * Weight, using Brozek's formula (lbs)
    + - +neck: Neck circumference (cm)
    + - +chest: Chest circumference (cm)
    + - +abdomen: Abdomen circumference (cm) "at the umbilicus and level with the iliac crest"
    + - +hip: Hip circumference (cm)
    + - thigh: Thigh circumference (cm)
    + - +knee: Knee circumference (cm)
    + - +ankle: Ankle circumference (cm)
    + - +bicep: Extended biceps circumference (cm)
    + - forearm: Forearm circumference (cm)
    + - +wrist: Wrist circumference (cm) "distal to the styloid processes"
    Note that + observation 182 in the original dataset has been removed because it + reported a percent body fat estimate equal to 0. The purpose is to predict + body_fat from the other measurements.
    The source of the + data is attributed to Dr. A. Garth Fisher, Human Performance Research + Center, Brigham Young University, Provo, Utah 84602, + fondi The fondi data set, introduced by Zani (2000), @@ -234,12 +278,30 @@

    Data matrices

    which allows different transformations for positive and negative responses is neede to analyze these data.
    - + head The Swiss Heads dataset was introduced by B. Flury and H. Riedwyl (1988). It contains information on six variables describing the dimensions of the heads of 200 twenty year old Swiss soldiers. + + + hprice + Sales prices of 546 houses in the city of Windsor, + Ontario, Canada, during July, August and September, 1987.
    The variables + are
    - lotsize: the lot size of a property in square feet
    - + bedrooms: number of bedrooms
    - bathrms: number of full bathrooms
    - + stories number of stories excluding basement 
    - driveway does the + house has a driveway?
    - recroom does the house has a recreational + room?
    - fullbase: does the house has a full finished basement?
    - + gashw: does the house uses gas for hot water heating?
    - airco: does + the house has central air conditioning?
    - garagepl: number of garage + places
    - prefarea: is the house located in the preferred neighbourhood + of the city?
    -price: sale price of a house.

    The reference is + Verbeek, Marno (2004) A Guide to Modern Econometrics, John Wiley and Sons, + chapter 3. Journal of Applied Econometrics data archive : + http://qed.econ.queensu.ca/jae/ + . milk @@ -435,8 +497,8 @@

    Contingency tables

    SportHealth - The dataset SportHealth contains a contingency table between "Physical Activity Frequency" and self assesment "Quality of Life Ratings". - The number of people interviewed is 303. + The SportHealth dataset contains a contingency table between "Physical Activity Frequency" and self assesment "Quality of Life Ratings". + The number of people interviewed is 303. diff --git a/toolbox/helpfiles/FSDA/images/corrOrdinal_01.png b/toolbox/helpfiles/FSDA/images/corrOrdinal_01.png index b6f274eec..13f7db578 100644 Binary files a/toolbox/helpfiles/FSDA/images/corrOrdinal_01.png and b/toolbox/helpfiles/FSDA/images/corrOrdinal_01.png differ diff --git a/toolbox/helpfiles/FSDA/images/corrOrdinal_02.png b/toolbox/helpfiles/FSDA/images/corrOrdinal_02.png index 3b3e51e6a..8db84c48f 100644 Binary files a/toolbox/helpfiles/FSDA/images/corrOrdinal_02.png and b/toolbox/helpfiles/FSDA/images/corrOrdinal_02.png differ diff --git a/toolbox/helpfiles/FSDA/images/corrOrdinal_03.png b/toolbox/helpfiles/FSDA/images/corrOrdinal_03.png index 816708e4a..04025271e 100644 Binary files a/toolbox/helpfiles/FSDA/images/corrOrdinal_03.png and b/toolbox/helpfiles/FSDA/images/corrOrdinal_03.png differ diff --git a/toolbox/helpfiles/FSDA/images/corrOrdinal_04.png b/toolbox/helpfiles/FSDA/images/corrOrdinal_04.png index 4d6af91f4..825ff77d0 100644 Binary files a/toolbox/helpfiles/FSDA/images/corrOrdinal_04.png and b/toolbox/helpfiles/FSDA/images/corrOrdinal_04.png differ diff --git a/toolbox/multivariate/corrOrdinal.m b/toolbox/multivariate/corrOrdinal.m index a8be8e426..75144c6cb 100644 --- a/toolbox/multivariate/corrOrdinal.m +++ b/toolbox/multivariate/corrOrdinal.m @@ -150,11 +150,11 @@ % (third column), upper confidence limit (fourth column). % Note that the standard errors in this table are computed not % assuming the null hypothesis of independence. -% out.IndContr2CminusD = IxJ array containing individual contributions to -% the commpon numerator of all the indexes above (namely +% out.Contrib2CminusD = IxJ array containing individual contributions to +% the common numerator of all the indexes above (namely % C-D). -% out.IndContr2CminusDtable = IxJ table containing individual contributions to -% the commpon numerator of all the indexes above (namely +% out.Contrib2CminusDtable = IxJ table containing individual contributions to +% the common numerator of all the indexes above (namely % C-D). % % @@ -166,9 +166,9 @@ % variable also is higher on the other variable, and a pair of observations % is discordant if the subject who is higher on one variable is lower on % the other variable. -% More formally, a pair (i,j), i=1, 2, ..., n is concordant if -% (x(i)-x(j)) $\times$ (y(i)-y(j))>0. -% It is discordant if (x(i)-x(j) ) $\times$ (y(i)-y(j))<0 +% More formally, a pair $(i,j)$, $i=1, 2, ..., n$ is concordant if +% $(x(i)-x(j)) \times (y(i)-y(j))>0$. +% It is discordant if $(x(i)-x(j) ) \times (y(i)-y(j))<0$. % Let $C$ be the total number of concordant pairs (concordances) and $D$ % the total number of discordant pairs (discordances) . If $C > D$ the % variables have a positive association, but if $C < D$ then the variables @@ -500,7 +500,7 @@ %{ %% Example 2 of use of option plots. - % Opinion on the movied watched and age interval + % Opinion on the movie watched and age interval load cinema.mat out=corrOrdinal(cinema,'plots',true); % It is clear the negative relationship between @@ -746,7 +746,7 @@ pvaltaua = 2*(1 - normcdf(abs(ztaua))); %p-value (two-sided) %% tau-b statistic - % For computationl purposes it is better to use relative frequencies + % For computational purposes it is better to use relative frequencies % rather than absolute frequencies Pi=N/n; % matrix of relative frequencies pdiff=(con-dis)/n; @@ -755,7 +755,7 @@ delta2=sqrt(1 - sum((ndotj/n).^2)); tauij=(2 * pdiff + Pdiff * repmat(ndotj/n,I,1) ) * delta2 * delta1 + ... (Pdiff * repmat(nidot/n,1,J) * delta2)/delta1; - % setaub = standard errot used to compute the confidence interval + % setaub = standard error used to compute the confidence interval setaub= sqrt(( ( sum(Pi(:) .* tauij(:).^2) - sum(Pi(:) .* tauij(:)).^2)/(delta1 * delta2)^4)/n); % The formula written in the help section (which uses the absolute @@ -788,7 +788,7 @@ pvaltauc = 2*(1 - normcdf(abs(ztauc))); %p-value (two-sided) %% Somers' D statistic - % Find standard error of Somers D stat + % Find standard error of Somers' D stat nidotrep=repmat(nidot,1,J); % sesom = standard errot used to compute the confidence interval @@ -846,10 +846,10 @@ out.ConfLimtable=ConfLimtable; NconMinusNdis=Ncon-Ndis; -out.IndContr2CminusD=NconMinusNdis; -IndContr2CminusDtable=Ntable; -IndContr2CminusDtable{:,:}=NconMinusNdis; -out.IndContr2CminusDtable=IndContr2CminusDtable; +out.Contrib2CminusD=NconMinusNdis; +Contrib2CminusDtable=Ntable; +Contrib2CminusDtable{:,:}=NconMinusNdis; +out.Contrib2CminusDtable=Contrib2CminusDtable; if dispresults == true if NoStandardErrors == false