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

How can I save my multiple lm summary output to a data frame or csv?

I am trying to save the summary outputs of a lm into a data frame, "csv" or "txt" file. What I wanted to do is to use a lm (and eventually glm) with different dependent variables, but the same independent variables. This is my code using lapply for…
1
vote
1 answer

binary tree implementation in php and mysql(genealogy)

I am trying to do an MLM project in PHP. Now I'm stuck on the binary tree representation of MLM. Please help me to implement the tree.sample tree structre. Please help me to build a tree-like on the attached image. Sample tree structre
1
vote
0 answers

I am making a multi level networking referral system and want some suggestions

I am going to make multi level referral system which is not a binary system. If A is the parent of B and B is the parent of C. If C do any action, some percentage will be distributed between B and A. I will use for loop for giving certain…
geekhere
  • 99
  • 1
  • 2
  • 12
1
vote
1 answer

Using 'mlm` object in `mtable` output

Is there any way to work with mlm objects in mtable from the memisc package? Without using multiple response matrix, what I want is something like: library(car) library(memisc) lm1 = lm(Sepal.Length ~ Petal.Length + Petal.Width + Species,…
Lee Hachadoorian
  • 364
  • 2
  • 15
1
vote
1 answer

Run lm with multiple responses and weights

I have to fit a linear model with the same model matrix to multiple responses. This can be easily done in R by specifying the response as matrix instead of a vector. Computation is very fast in this way. Now I would also like to add weights to the…
Raivo Kolde
  • 729
  • 6
  • 14
0
votes
0 answers

Why do my spss-syntax and r-code do not produce the same (or nearly the same) results modeling an mlm?

I did my analyses with spss, but now I wanted to use bootstrapping, so I'm trying to "translate" my model into r (I'm still a complete newbie here). Unfortunately, I do not get nearly the same results, which makes me very unsure - what could have…
Newbie
  • 1
0
votes
0 answers

uni level MLM Calculation. i have: User-> HasMany::Users, User-> HasMany::trading , trading-> HasOne::trading_data->balance | Laravel

in this picture all are users. User::hasMany(User::class, 'ref_by'); User::hasMany(Trading::class); Trading::hasOne(TradingData::class); Now i want to sum balance from TradingData for user(B). Where B hasMany User and They also hasMany Users.
Rajib Bin Alam
  • 353
  • 1
  • 4
  • 16
0
votes
0 answers

Linear Mixed Model (LMM) with statsmodels library (syntax suggestion)

I have a dataset that I tried that I want to analyised with Linear Mixed Effect (LMM). The Fixed effect is a binary classification (H and L), and the Block effect is Region (A, B and C). In other words, I wanted so see if Test1 and Test2 predict…
jsmgl
  • 1
  • 1
0
votes
2 answers

Export APA format table of lme4 anova results

I ran this MLM model model1.a <- lmer(log10_number_of_sensations ~ Tone*Location + Tone*Intensity +(1+Tone+Intensity|Subject), neutralBlock_data,REML=TRUE) and I used "lmertest" to get the repeated measure anova…
omer
  • 69
  • 6
0
votes
0 answers

MLM logic building using solidity smart contract?

I want to create solidity smart contract for MLM site like OXCash Data structure which is suitable for the logic and or any other logic
0
votes
0 answers

Fixing convergence issues with applying random effect modeling to multiply imputed longitudinal data

I am trying to run a random effects model using longitudinal data with repeated measures. I used MICE to impute the missing values and created 20 MI data sets. When running the model(s), I am given the following warnings: Warning: Model failed to…
0
votes
1 answer

lme4 Random Effect MLM

I have a question about random effect in repeated measures design with 4 within-subjects factor (x1, x2, x3, x4) What the differences between these 2 ways of defining random effects: Option 1. (1 + x1 + x2 + x3 + x4 | Subject) Option 2. (1 + x1 |…
omer
  • 69
  • 6
0
votes
1 answer

how to get child and subchild of any parent user e.g, want to get nested child in php laravel

I am working on a MLM System, i want to get all childs & subchilds of any parent user. i tried use of recursion but failed. please help me to solve this. public function searchAllDownline(Request $req){ $ids = array(); …
Saim Khan
  • 31
  • 1
  • 3
0
votes
2 answers

Subset cases in which there were more than 3 observations in longitudinal data?

Have a set of longitudinal data in which measures were repeatedly collected at various waves (see example of set up below. As this sort of data goes however, there was attrition, with some waves stopping before the study ended. However, my analysis…
Justin B
  • 3
  • 1
0
votes
0 answers

SQL QUERY for parent child relationship and Dynamic Compression

I need help writing a query for a parent-child relationship with dynamic compression. The table here is member_id parent_id fullname username product 1 0 Alpha alpha 1 2 1 A A …
wasimjee
  • 49
  • 1
  • 6