In this analysis we try to infer the effect of aging on the cell type composition in mouse tissue samples.

Paper reference

Link to Reference on Dirichlet Regression

Load libraries

library (DirichletReg)
Loading required package: Formula
library(tidyverse)
Registered S3 methods overwritten by 'dbplyr':
  method         from
  print.tbl_lazy     
  print.tbl_sql      
── Attaching packages ─────────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.0 ──
✓ ggplot2 3.3.3     ✓ purrr   0.3.4
✓ tibble  3.0.6     ✓ dplyr   1.0.4
✓ tidyr   1.1.2     ✓ stringr 1.4.0
✓ readr   1.4.0     ✓ forcats 0.5.1
── Conflicts ────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
x dplyr::filter() masks stats::filter()
x dplyr::lag()    masks stats::lag()

Load data

facs_dt <- read_tsv("cells_type_facs_proportions.txt")

── Column specification ────────────────────────────────────────────────────────────────────────────────────────────────────
cols(
  musc = col_double(),
  macrophage = col_double(),
  fap = col_double(),
  condition = col_character()
)
facs_dt <- 
  facs_dt  %>%
  relocate(fap, .before =musc ) %>%
  mutate(condition=if_else(condition=="yng", 0, 1))
facs_dt
inputData <- facs_dt
inputData$Y <- DR_data(facs_dt[,1:3])
not all rows sum up to 1 => normalization forced
plot(inputData$Y)

Fit models

Three covariate model

Model 1: The age covariate of the three components does not differ. That is, it affects all components.

fit1 <- DirichReg(Y ~ condition, inputData)
summary(fit1)

Call:
DirichReg(formula = Y ~ condition, data = inputData)

Standardized Residuals:
                Min       1Q   Median      3Q     Max
fap         -1.2876  -0.9208  -0.1898  0.9336  1.6134
musc        -1.8891  -0.4261  -0.0371  0.5281  1.5665
macrophage  -1.1906  -0.7241  -0.1744  0.6942  1.8624

------------------------------------------------------------------
Beta-Coefficients for variable no. 1: fap
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   2.4473     0.5044   4.852 1.23e-06 ***
condition     0.4116     0.7193   0.572    0.567    
------------------------------------------------------------------
Beta-Coefficients for variable no. 2: musc
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   3.4052     0.5048   6.746 1.52e-11 ***
condition    -0.8491     0.7194  -1.180    0.238    
------------------------------------------------------------------
Beta-Coefficients for variable no. 3: macrophage
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   2.0841     0.5041   4.134 3.56e-05 ***
condition    -1.2559     0.7146  -1.758   0.0788 .  
------------------------------------------------------------------
Significance codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Log-likelihood: 23.74 on 6 df (55 BFGS + 1 NR Iterations)
AIC: -35.48, BIC: -35.01
Number of Observations: 8
Link: Log
Parametrization: common
predict(fit1)
           fap      musc macrophage
[1,] 0.2324647 0.6058644  0.1616709
[2,] 0.2324647 0.6058644  0.1616709
[3,] 0.2324647 0.6058644  0.1616709
[4,] 0.2324647 0.6058644  0.1616709
[5,] 0.5347745 0.3950431  0.0701824
[6,] 0.5347745 0.3950431  0.0701824
[7,] 0.5347745 0.3950431  0.0701824
[8,] 0.5347745 0.3950431  0.0701824

One covariate models

Model 2: The age covariate affects MuSC only

fit2 <- DirichReg(Y ~ 1 |condition|1, inputData)
summary(fit2)

Call:
DirichReg(formula = Y ~ 1 | condition | 1, data = inputData)

Standardized Residuals:
                Min       1Q   Median      3Q     Max
fap         -1.2748  -0.6187   0.0075  0.5830  1.4535
musc        -1.3099  -0.3789  -0.0975  0.2902  0.9938
macrophage  -1.4040  -0.8419   0.1303  0.8273  1.7462

------------------------------------------------------------------
Beta-Coefficients for variable no. 1: fap
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   1.8398     0.3644   5.049 4.44e-07 ***
------------------------------------------------------------------
Beta-Coefficients for variable no. 2: musc
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   2.5724     0.3957   6.500 8.02e-11 ***
condition    -0.8279     0.3340  -2.479   0.0132 *  
------------------------------------------------------------------
Beta-Coefficients for variable no. 3: macrophage
            Estimate Std. Error z value Pr(>|z|)  
(Intercept)   0.7135     0.3596   1.984   0.0473 *
------------------------------------------------------------------
Significance codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Log-likelihood: 17.16 on 4 df (42 BFGS + 1 NR Iterations)
AIC: -26.32, BIC: -26
Number of Observations: 8
Link: Log
Parametrization: common
predict(fit2)
           fap      musc macrophage
[1,] 0.2937053 0.6110673 0.09522741
[2,] 0.2937053 0.6110673 0.09522741
[3,] 0.2937053 0.6110673 0.09522741
[4,] 0.2937053 0.6110673 0.09522741
[5,] 0.4477481 0.4070796 0.14517235
[6,] 0.4477481 0.4070796 0.14517235
[7,] 0.4477481 0.4070796 0.14517235
[8,] 0.4477481 0.4070796 0.14517235

Model 3: The age covariate affects macrophage only

fit3 <- DirichReg(Y ~ 1 |1 |condition, inputData) 
summary(fit3)

Call:
DirichReg(formula = Y ~ 1 | 1 | condition, data = inputData)

Standardized Residuals:
                Min       1Q   Median      3Q     Max
fap         -1.4979  -0.9611   0.0679  0.9565  1.9593
musc        -1.6255  -1.1770  -0.0867  1.1874  1.9482
macrophage  -0.9468  -0.5843  -0.3345  0.1894  0.8924

------------------------------------------------------------------
Beta-Coefficients for variable no. 1: fap
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   1.6769     0.3665   4.575 4.76e-06 ***
------------------------------------------------------------------
Beta-Coefficients for variable no. 2: musc
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   1.9866     0.3674   5.407 6.39e-08 ***
------------------------------------------------------------------
Beta-Coefficients for variable no. 3: macrophage
            Estimate Std. Error z value Pr(>|z|)  
(Intercept)   1.0178     0.4198   2.425   0.0153 *
condition    -0.8322     0.4878  -1.706   0.0880 .
------------------------------------------------------------------
Significance codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Log-likelihood: 15.89 on 4 df (40 BFGS + 1 NR Iterations)
AIC: -23.79, BIC: -23.47
Number of Observations: 8
Link: Log
Parametrization: common
predict(fit3)
           fap      musc macrophage
[1,] 0.3471766 0.4732138 0.17960966
[2,] 0.3471766 0.4732138 0.17960966
[3,] 0.3471766 0.4732138 0.17960966
[4,] 0.3471766 0.4732138 0.17960966
[5,] 0.3863808 0.5266505 0.08696866
[6,] 0.3863808 0.5266505 0.08696866
[7,] 0.3863808 0.5266505 0.08696866
[8,] 0.3863808 0.5266505 0.08696866

Model 4: The age covariate affects fap only

fit4 <- DirichReg(Y ~ condition |1 |1, inputData)  
summary(fit4)

Call:
DirichReg(formula = Y ~ condition | 1 | 1, data = inputData)

Standardized Residuals:
                Min       1Q   Median      3Q     Max
fap         -1.4325  -0.7952  -0.2831  1.0118  1.3223
musc        -1.5837  -0.3279  -0.0993  0.2424  1.5819
macrophage  -1.5535  -0.5274  -0.1409  0.9322  1.6319

------------------------------------------------------------------
Beta-Coefficients for variable no. 1: fap
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   1.8168     0.3915   4.640 3.48e-06 ***
condition     1.2881     0.2681   4.804 1.55e-06 ***
------------------------------------------------------------------
Beta-Coefficients for variable no. 2: musc
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   2.7752     0.3602   7.705 1.31e-14 ***
------------------------------------------------------------------
Beta-Coefficients for variable no. 3: macrophage
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)    1.249      0.358   3.488 0.000487 ***
------------------------------------------------------------------
Significance codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Log-likelihood: 22.09 on 4 df (35 BFGS + 2 NR Iterations)
AIC: -36.18, BIC: -35.86
Number of Observations: 8
Link: Log
Parametrization: common
predict(fit4)
           fap      musc macrophage
[1,] 0.2395629 0.6246963 0.13574079
[2,] 0.2395629 0.6246963 0.13574079
[3,] 0.2395629 0.6246963 0.13574079
[4,] 0.2395629 0.6246963 0.13574079
[5,] 0.5332003 0.3834743 0.08332545
[6,] 0.5332003 0.3834743 0.08332545
[7,] 0.5332003 0.3834743 0.08332545
[8,] 0.5332003 0.3834743 0.08332545

Fit 4 is the best fitting one covariate model

Two covariate models

Model 5: The age covariate affects both musc and macrophage only

fit5 <- DirichReg(Y ~ 1 |condition |condition, inputData)  
summary(fit5)

Call:
DirichReg(formula = Y ~ 1 | condition | condition, data = inputData)

Standardized Residuals:
                Min       1Q   Median      3Q     Max
fap         -1.1579  -1.0202  -0.1285  0.8958  1.7152
musc        -2.0454  -0.4069  -0.0242  0.5163  1.7144
macrophage  -1.1364  -0.7569  -0.2176  0.7858  1.5758

------------------------------------------------------------------
Beta-Coefficients for variable no. 1: fap
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   2.6280     0.3603   7.293 3.03e-13 ***
------------------------------------------------------------------
Beta-Coefficients for variable no. 2: musc
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   3.5766     0.3763   9.504  < 2e-16 ***
condition    -1.2354     0.2505  -4.931 8.17e-07 ***
------------------------------------------------------------------
Beta-Coefficients for variable no. 3: macrophage
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   2.2483     0.3868   5.813 6.14e-09 ***
condition    -1.5961     0.3934  -4.057 4.96e-05 ***
------------------------------------------------------------------
Significance codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Log-likelihood: 23.58 on 5 df (55 BFGS + 1 NR Iterations)
AIC: -37.16, BIC: -36.76
Number of Observations: 8
Link: Log
Parametrization: common
predict(fit5)
           fap      musc macrophage
[1,] 0.2344105 0.6052355 0.16035392
[2,] 0.2344105 0.6052355 0.16035392
[3,] 0.2344105 0.6052355 0.16035392
[4,] 0.2344105 0.6052355 0.16035392
[5,] 0.5292959 0.3973182 0.07338587
[6,] 0.5292959 0.3973182 0.07338587
[7,] 0.5292959 0.3973182 0.07338587
[8,] 0.5292959 0.3973182 0.07338587

Model 6: The age covariate affects both macrophage and fap only

fit6 <- DirichReg(Y ~  condition | 1 | condition, inputData)  
summary(fit6)

Call:
DirichReg(formula = Y ~ condition | 1 | condition, data = inputData)

Standardized Residuals:
                Min       1Q   Median      3Q     Max
fap         -1.4821  -0.8244  -0.2783  1.0759  1.3790
musc        -1.3654  -0.5774  -0.0586  0.5894  1.3907
macrophage  -1.3303  -0.6411  -0.1085  0.4608  2.3400

------------------------------------------------------------------
Beta-Coefficients for variable no. 1: fap
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   1.9761     0.3883   5.089  3.6e-07 ***
condition     1.2054     0.2595   4.645  3.4e-06 ***
------------------------------------------------------------------
Beta-Coefficients for variable no. 2: musc
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   2.8967     0.3596   8.056  7.9e-16 ***
------------------------------------------------------------------
Beta-Coefficients for variable no. 3: macrophage
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   1.6242     0.3952   4.110 3.96e-05 ***
condition    -0.5239     0.3686  -1.421    0.155    
------------------------------------------------------------------
Significance codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Log-likelihood: 23.06 on 5 df (45 BFGS + 1 NR Iterations)
AIC: -36.13, BIC: -35.73
Number of Observations: 8
Link: Log
Parametrization: common
predict(fit6)
           fap      musc macrophage
[1,] 0.2372955 0.5958070 0.16689744
[2,] 0.2372955 0.5958070 0.16689744
[3,] 0.2372955 0.5958070 0.16689744
[4,] 0.2372955 0.5958070 0.16689744
[5,] 0.5327840 0.4007381 0.06647788
[6,] 0.5327840 0.4007381 0.06647788
[7,] 0.5327840 0.4007381 0.06647788
[8,] 0.5327840 0.4007381 0.06647788

Model 7: The age covariate affects both fap and musc only

fit7 <- DirichReg(Y ~  condition | condition | 1, inputData) 
summary(fit7)

Call:
DirichReg(formula = Y ~ condition | condition | 1, data = inputData)

Standardized Residuals:
                Min       1Q   Median      3Q     Max
fap         -1.5125  -0.8145  -0.2857  1.0313  1.4135
musc        -1.3694  -0.4706  -0.0886  0.3813  1.5497
macrophage  -1.5166  -0.6144  -0.1373  0.6769  2.0274

------------------------------------------------------------------
Beta-Coefficients for variable no. 1: fap
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   1.7486     0.4184   4.179 2.92e-05 ***
condition     1.4783     0.4012   3.684 0.000229 ***
------------------------------------------------------------------
Beta-Coefficients for variable no. 2: musc
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   2.6789     0.4088   6.554 5.61e-11 ***
condition     0.2420     0.3818   0.634    0.526    
------------------------------------------------------------------
Beta-Coefficients for variable no. 3: macrophage
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)    1.271      0.358   3.549 0.000387 ***
------------------------------------------------------------------
Significance codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Log-likelihood: 22.29 on 5 df (54 BFGS + 1 NR Iterations)
AIC: -34.58, BIC: -34.18
Number of Observations: 8
Link: Log
Parametrization: common
predict(fit7)
           fap      musc macrophage
[1,] 0.2406582 0.6101354 0.14920646
[2,] 0.2406582 0.6101354 0.14920646
[3,] 0.2406582 0.6101354 0.14920646
[4,] 0.2406582 0.6101354 0.14920646
[5,] 0.5325522 0.3921624 0.07528543
[6,] 0.5325522 0.3921624 0.07528543
[7,] 0.5325522 0.3921624 0.07528543
[8,] 0.5325522 0.3921624 0.07528543

Fit 5 is the best fitting two covariates model

Model 8: Mean-Precision parmaterization

The alternative parametrization consists of two parts: modeled expected values (mu) and their ‘precision’ (phi). As in multinomial logistic regfitsion, one reponse variable is omitted (by default the first) and for the fit a set of predictors is used with a multinomial logit-link. The age covariate affects the musc and fap, and also the the heteroscedasticity of the data.

fit8 <- DirichReg(Y ~ condition | condition, inputData, model="alternative")
summary(fit8)

Call:
DirichReg(formula = Y ~ condition | condition, data = inputData, model = "alternative")

Standardized Residuals:
                Min       1Q   Median      3Q     Max
fap         -1.2876  -0.9208  -0.1898  0.9336  1.6134
musc        -1.8891  -0.4261  -0.0371  0.5281  1.5665
macrophage  -1.1906  -0.7241  -0.1744  0.6942  1.8624

MEAN MODELS:
------------------------------------------------------------------
Coefficients for variable no. 1: fap
- variable omitted (reference category) -
------------------------------------------------------------------
Coefficients for variable no. 2: musc
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   0.9579     0.1704   5.620 1.90e-08 ***
condition    -1.2608     0.2483  -5.077 3.83e-07 ***
------------------------------------------------------------------
Coefficients for variable no. 3: macrophage
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)  -0.3632     0.2236  -1.624    0.104    
condition    -1.6676     0.3989  -4.181  2.9e-05 ***
------------------------------------------------------------------

PRECISION MODEL:
------------------------------------------------------------------
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   3.9063     0.4949   7.893 2.96e-15 ***
condition    -0.4215     0.7023  -0.600    0.548    
------------------------------------------------------------------
Significance codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Log-likelihood: 23.74 on 6 df (29 BFGS + 1 NR Iterations)
AIC: -35.48, BIC: -35.01
Number of Observations: 8
Links: Logit (Means) and Log (Precision)
Parametrization: alternative
predict(fit8)
           fap      musc macrophage
[1,] 0.2324647 0.6058644  0.1616709
[2,] 0.2324647 0.6058644  0.1616709
[3,] 0.2324647 0.6058644  0.1616709
[4,] 0.2324647 0.6058644  0.1616709
[5,] 0.5347745 0.3950431  0.0701824
[6,] 0.5347745 0.3950431  0.0701824
[7,] 0.5347745 0.3950431  0.0701824
[8,] 0.5347745 0.3950431  0.0701824

Model 9: Mean-Precision parmaterization. Condition affects mean only

fit9 <- DirichReg(Y ~ condition | 1, inputData, model="alternative")
summary(fit9)

Call:
DirichReg(formula = Y ~ condition | 1, data = inputData, model = "alternative")

Standardized Residuals:
                Min       1Q   Median      3Q     Max
fap         -1.4328  -0.8354  -0.2571  1.0046  1.4273
musc        -1.6579  -0.4731  -0.0472  0.5549  1.4257
macrophage  -1.2734  -0.6677  -0.1435  0.5949  2.1209

MEAN MODELS:
------------------------------------------------------------------
Coefficients for variable no. 1: fap
- variable omitted (reference category) -
------------------------------------------------------------------
Coefficients for variable no. 2: musc
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   0.9509     0.1901   5.003 5.63e-07 ***
condition    -1.2556     0.2515  -4.992 5.96e-07 ***
------------------------------------------------------------------
Coefficients for variable no. 3: macrophage
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)  -0.3583     0.2484  -1.443    0.149    
condition    -1.7041     0.3899  -4.370 1.24e-05 ***
------------------------------------------------------------------

PRECISION MODEL:
------------------------------------------------------------------
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   3.6752     0.3508   10.48   <2e-16 ***
------------------------------------------------------------------
Significance codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Log-likelihood: 23.56 on 5 df (37 BFGS + 1 NR Iterations)
AIC: -37.13, BIC: -36.73
Number of Observations: 8
Links: Logit (Means) and Log (Precision)
Parametrization: alternative
predict(fit9)
           fap      musc macrophage
[1,] 0.2332642 0.6037236 0.16301216
[2,] 0.2332642 0.6037236 0.16301216
[3,] 0.2332642 0.6037236 0.16301216
[4,] 0.2332642 0.6037236 0.16301216
[5,] 0.5363304 0.3954813 0.06818828
[6,] 0.5363304 0.3954813 0.06818828
[7,] 0.5363304 0.3954813 0.06818828
[8,] 0.5363304 0.3954813 0.06818828

Determine best fitting model

Determine whether the full model is a better fit than the best fitting one covariate model (fit4)

anova(fit4, fit1)

Analysis of Deviance Table

Model 1: DirichReg(formula = Y ~ condition | 1 | 1, data = inputData)
Model 2: DirichReg(formula = Y ~ condition, data = inputData)

        Deviance N. par Difference df Pr(>Chi)
Model 1  -44.183      4                       
Model 2  -47.483      6     3.3006  2    0.192

Model 1 is more parsimonous. Fit4 is better

Determine whether the best fitting two covariate model (fit5) is a better than the best fitting one covariate model (fit4)

anova(fit4, fit5)

Analysis of Deviance Table

Model 1: DirichReg(formula = Y ~ condition | 1 | 1, data = inputData)
Model 2: DirichReg(formula = Y ~ 1 | condition | condition, data = inputData)

        Deviance N. par Difference df Pr(>Chi)  
Model 1  -44.183      4                         
Model 2  -47.159      5     2.9767  1  0.08447 .
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Model 2 is slightly better

Determine whether mean or mean-percision model is a better fit

anova(fit8, fit9)

Analysis of Deviance Table

Model 1: DirichReg(formula = Y ~ condition | condition, data = inputData, model = "alternative")
Model 2: DirichReg(formula = Y ~ condition | 1, data = inputData, model = "alternative")

        Deviance N. par Difference df Pr(>Chi)
Model 1  -47.483      6                       
Model 2  -47.125      5     0.3581  1   0.5496

Model 2 (fit9 is more parsimonious)

anova(fit9, fit4)

Analysis of Deviance Table

Model 1: DirichReg(formula = Y ~ condition | 1, data = inputData, model = "alternative")
Model 2: DirichReg(formula = Y ~ condition | 1 | 1, data = inputData)

        Deviance N. par Difference df Pr(>Chi)  
Model 1  -47.125      5                         
Model 2  -44.183      4     2.9425  1  0.08628 .
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
anova(fit9, fit5)

Analysis of Deviance Table

Model 1: DirichReg(formula = Y ~ condition | 1, data = inputData, model = "alternative")
Model 2: DirichReg(formula = Y ~ 1 | condition | condition, data = inputData)

        Deviance N. par Difference df  Pr(>Chi)    
Model 1  -47.125      5                            
Model 2  -47.159      5     0.0342  0 < 2.2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Model 2 (fit5) is the best fitting model

Rerun the best fitting model

fit5 <- DirichReg(Y ~ 1 |condition |condition, inputData)  
summary(fit5)

Call:
DirichReg(formula = Y ~ 1 | condition | condition, data = inputData)

Standardized Residuals:
                Min       1Q   Median      3Q     Max
fap         -1.1579  -1.0202  -0.1285  0.8958  1.7152
musc        -2.0454  -0.4069  -0.0242  0.5163  1.7144
macrophage  -1.1364  -0.7569  -0.2176  0.7858  1.5758

------------------------------------------------------------------
Beta-Coefficients for variable no. 1: fap
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   2.6280     0.3603   7.293 3.03e-13 ***
------------------------------------------------------------------
Beta-Coefficients for variable no. 2: musc
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   3.5766     0.3763   9.504  < 2e-16 ***
condition    -1.2354     0.2505  -4.931 8.17e-07 ***
------------------------------------------------------------------
Beta-Coefficients for variable no. 3: macrophage
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   2.2483     0.3868   5.813 6.14e-09 ***
condition    -1.5961     0.3934  -4.057 4.96e-05 ***
------------------------------------------------------------------
Significance codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Log-likelihood: 23.58 on 5 df (55 BFGS + 1 NR Iterations)
AIC: -37.16, BIC: -36.76
Number of Observations: 8
Link: Log
Parametrization: common

Aging has an effect on the compostion of cell types by shifting the mean of the components down in two dimensions only (macrophage and MuSC)

inputData$Y
           fap      musc macrophage
[1,] 0.2522523 0.6176176 0.13013013
[2,] 0.1800900 0.7133567 0.10655328
[3,] 0.3281641 0.4762381 0.19559780
[4,] 0.1711198 0.6254378 0.20344241
[5,] 0.4734261 0.3743369 0.15223701
[6,] 0.6340000 0.3160000 0.05000000
[7,] 0.4240000 0.5010000 0.07500000
[8,] 0.6087914 0.3734855 0.01772304
param <- predict(fit5, data.frame(condition = factor(c(0, 1))), mu = T, alpha = T, phi=T)
param
$mu
          [,1]      [,2]       [,3]
[1,] 0.2344105 0.6052355 0.16035392
[2,] 0.5292959 0.3973182 0.07338587

$alpha
         [,1]     [,2]     [,3]
[1,] 13.84617 35.75008 9.471792
[2,] 13.84617 10.39369 1.919745

$phi
[1] 59.06804 26.15960
plot(inputData$Y, cex = 0.001, reset_par = FALSE)
div.col <- colorRampPalette(c("#023FA5", "#c0c0c0", "#8E063B"))(100)
temp <- (param$alpha/rowSums(param$alpha))
points(toSimplex(param$mu/rowSums(param$mu)), 
       pch = 23, 
       bg = div.col[c(1, 100)], 
       cex = 2, 
       lwd = 0.25)
points(toSimplex(inputData$Y),
       pch = 21,
       bg = gl(2, 4, labels=(div.col[c(1, 100)])),
       cex = 1, lwd = 0.25)
lines(toSimplex(param$mu/rowSums(param$mu)),
      lwd = 3,
      col = c("#6E1D34"), 
      lty = "21")
legend("topright", bty = "n", legend = c("Young", "Aged", NA, "Expected Value Young", "Expected Value Aged"), 
    pch = c(21, 21, NA, 23, 23), pt.bg = c(div.col[c(1, 100)], NA, div.col[c(1, 100)]))

residuals

round(fit5$Y -predict(fit5), 2)
    fap  musc macrophage
1  0.02  0.01      -0.03
2 -0.05  0.11      -0.05
3  0.09 -0.13       0.04
4 -0.06  0.02       0.04
5 -0.06 -0.02       0.08
6  0.10 -0.08      -0.02
7 -0.11  0.10       0.00
8  0.08 -0.02      -0.06
sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] forcats_0.5.1      stringr_1.4.0      dplyr_1.0.4        purrr_0.3.4        readr_1.4.0        tidyr_1.1.2       
 [7] tibble_3.0.6       ggplot2_3.3.3      tidyverse_1.3.0    DirichletReg_0.7-1 Formula_1.2-4     

loaded via a namespace (and not attached):
 [1] zoo_1.8-8         tidyselect_1.1.0  xfun_0.20         haven_2.3.1       lattice_0.20-41   colorspace_2.0-0 
 [7] vctrs_0.3.6       generics_0.1.0    rlang_0.4.10      pillar_1.4.7      glue_1.4.2        withr_2.4.1      
[13] DBI_1.1.1         dbplyr_2.1.0      modelr_0.1.8      readxl_1.3.1      lifecycle_0.2.0   munsell_0.5.0    
[19] gtable_0.3.0      cellranger_1.1.0  rvest_0.3.6       knitr_1.31        miscTools_0.6-26  broom_0.7.4      
[25] Rcpp_1.0.6        scales_1.1.1      backports_1.2.1   jsonlite_1.7.2    fs_1.5.0          maxLik_1.5-2     
[31] hms_1.0.0         digest_0.6.27     stringi_1.5.3     grid_4.0.3        cli_2.3.0         tools_4.0.3      
[37] sandwich_3.0-1    magrittr_2.0.1    crayon_1.4.1      pkgconfig_2.0.3   ellipsis_0.3.1    xml2_1.3.2       
[43] reprex_1.0.0      lubridate_1.7.9.2 assertthat_0.2.1  httr_1.4.2        rstudioapi_0.13   R6_2.5.0         
[49] compiler_4.0.3   
LS0tCnRpdGxlOiAiTW91c2UgTXVzY2xlIFN0ZW0gQ2VsbCBQcm9qZWN0ICIKc3VidGl0bGU6ICJEaXJpY2hsZXQgUmVncmVzc2lvbiIKYXV0aG9yOiAKLSBuYW1lOiBSaWNrIEZhcm91bmkKICBhZmZpbGlhdGlvbjoKICAtICZjcnVrIEfDqW5vbWUgUXXDqWJlYyBJbm5vdmF0aW9uIENlbnRyZSwgTWNHaWxsIFVuaXZlcnNpdHksIE1vbnRyZWFsLCBDYW5hZGEKZGF0ZTogJ2ByIGZvcm1hdChTeXMuRGF0ZSgpLCAiJVktJUItJWQiKWAnCm91dHB1dDoKICBodG1sX25vdGVib29rOgogICAgZGZfcHJpbnQ6IHBhZ2VkCiAgICBjb2RlX2ZvbGRpbmc6IHNob3cKICAgIHRvYzogbm8KICAgIHRvY19mbG9hdDogCiAgICAgIGNvbGxhcHNlZDogZmFsc2UKICAgICAgc21vb3RoX3Njcm9s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