Questions tagged [mlm]

"mlm" (multiple / multivariate linear models; linear models with multiple LHS / responses) is a special class of model object returned by `lm()` function in R for fitting linear regression models. When using this tag, please specify [r] and [lm] tags as well.

"mlm" model class is not widely known by lm() users. For an introductory example, please refer to Fitting a linear model with multiple LHS. Also read Run lm with multiple responses and weights for the limitations of "mlm".


R does not have full support for "mlm" class at the moment. Here is an overview:

  • The following generic functions work and would return a matrix:

    coef(), residuals(), fitted(), vcov()
    
  • The following generic functions work and would return a list:

    summary(), anova()
    
  • The following generic functions have limited support for "mlm":

    predict()
    
  • The following generic functions do not work at all for "mlm":

    rstandard(), plot(), confint()
    

The aim of this wiki page is to direct "mlm" users to efficient solutions of various inference and diagnostic tasks. Here is a good collection:

Model Summary

Model Prediction

Model Diagnostic


Please read above questions carefully, and only ask a new question when it is not answered in above.

69 questions
1
vote
1 answer

Multilevel mediation analysis in R with mlma package produces errors

I would like to perform a multilevel mediation analysis in R with the mlma package. My code is based on the example for these analyses here: https://rdrr.io/cran/mlma/f/vignettes/MLMAvignette.Rmd. Overall, I am very unsure whether my code is…
Bila
  • 11
  • 2
1
vote
1 answer

R: comparing jglmm models

When using lmer, one can compare two models using anova: mod.ld.frq = lmer(ln_rt_offset ~ 1 + lfrq + (1 + lfrq | PID) + (1| Item), data=ldfw.std) mod.ld.frq.dur = lmer(ln_rt_offset ~ 1 + lfrq + duration + …
user20412
  • 193
  • 7
1
vote
1 answer

lme specifying correlation structure for three-level model

I'm new to R and to multilevel modeling. I have a data set where I have a dependent variable y and predictor x, both of which are measured one time per day over a number of days within subjects. In addition, each subject is part of a twin pair. So…
katyt
  • 11
  • 1
1
vote
1 answer

Using MICE for Growth Curve Model

I used MICE to impute data, and now I am trying to do growth curve modeling. I'm in the stage of assessing if there is a need for multlivevel modelling Here is my code ICept <-gls(edeqGLOBAL_mean ~ 1, data=Imputed, method = "ML",…
Taylor
  • 11
  • 1
1
vote
1 answer

Modelling multinomial dependent variable with longitudinal/panel data (R)

I'm having some trouble with an analyses I want to conduct and were wondering if there are any alternatives. Essentially I have a longitudinal dataset (or panel data), and a dependent variable (group membership) that is categorical and time…
1
vote
1 answer

Count of node of Hierarchical Data in MySQL

i got a solution from link below. this works very fine, but I want to count of items at different levels instead of names. anybody can help how it is possible. http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/ CREATE TABLE…
Ijaz
  • 5
  • 3
1
vote
2 answers

Looping through columns to analyse different dependent variable

Here my data frame (reproducible example) set.seed(42) n <- 6 dat <- data.frame(id=rep(1:n, 2), group= as.factor(rep(LETTERS[1:2], n/2)), VD1 = rnorm(n), VD2 = runif(n*2, min=0, max=100), …
Gianluca
  • 43
  • 1
  • 9
1
vote
0 answers

How to write code for Level 2 data for Multilevel Modeling using nlme package

I am struggling with how to describe level 2 data in my Multilevel Model in R. I am using the nlme package. I have longitudinal data with repeated measures. I have repeated observations for every subject across many days. The Goal: Level 1 would be…
1
vote
0 answers

Trying to calculate the indirect effects in a multilevel structural equation model using Stata. Can someone confirm than I have this code right?

I'm trying to build a multilevel structural equation model in stata, using Example 42g in the Stata handbook as a guide. My code is working, but I'm going off-book a little in calculating the indirect effects and could just use a sanity check from…
1
vote
1 answer

how to take team total for unilevel mlm tree

I need to find the team total for the unilevel mlm tree I am having users table as this +-------+-------+-----------+ | id | fname | parent_id | +=======+=======+===========+ | sk001 | aa | null | +-------+-------+-----------+ | sk002 |…
Sam Leumas
  • 33
  • 4
1
vote
0 answers

RuntimeError on declaring Reference to other MLM

It appears the compiler doesn't recognize the single tic at the end of the line to end the MLM name. After testing different scenarios, I learned, the only tic recognized is the last in the data segment. How can I declare multiple MLM and…
1
vote
1 answer

Excel formula like MLM

As the picture, the explanation as below: J.Li and E.Bn will join into R.B team, then you can see the Level 1 those have 1. Then J.Li and E.Bn they also have their team, so that B.Ko and K.Un will join into J.Li team, you can also see that Level 1…
Cody Tong
  • 39
  • 5
1
vote
0 answers

Depth of ternary tree - MLM Level

I am working on a MLM in php where every node can have only 3 children. the MLM have N Levels. the Level of any parent node will be equal to the lowest level of its child node + 1. child at depth n has Level = 1. function calculate_level($starId=0)…
dfeast
  • 36
  • 1
  • 4
1
vote
0 answers

Recursive Cypher query for MLM graph

I have an MLM graph where any customer can share a business with another customer. so I have designed model like Nodes for shares, customers, businesses, and edges for the source(to business), from, to. Now, whenever customer(c4) made a purchase…
Jaydipsinh
  • 491
  • 1
  • 9
  • 27
1
vote
0 answers

PHP - MLM show node on its respective side of tree

I'm building a binary tree in PHP. Everything looking good so far but now I'm getting a problem. Node that I placed on right side is showing at left side when we placed right node before left. System looking good if we place left node first and…
Neeraj Sharma
  • 311
  • 2
  • 4
  • 13