similar to: manipulating data via the factors of a term in a lm()

Displaying 20 results from an estimated 8000 matches similar to: "manipulating data via the factors of a term in a lm()"

2007 Aug 28
0
help with aggregate(): tables of means for terms in an mlm
I'm trying to extend some work in the car and heplots packages that requires getting a table of multivariate means for one (or later, more) terms in an mlm object. I can do this for concrete examples, using aggregate(), but can't figure out how to generalize it. I want to return a result that has the factor-level combinations as rownames, and the means as the body of the table
2012 Mar 16
1
multivariate regression and lm()
Hello, I would like to perform a multivariate regression analysis to model the relationship between m responses Y1, ... Ym and a single set of predictor variables X1, ..., Xr. Each response is assumed to follow its own regression model, and the error terms in each model can be correlated. Based on my readings of the R help archives and R documentation, the function lm() should be able to
2006 Nov 21
4
means over factors in mlm terms
I'm trying to write a function to find the means over factors of the responses in a mlm (something I would do easily in SAS with PROC SUMMARY). The not-working stub of a function to do what I want is below, and my problem is that I don't know how to call aggregate (or some other function) in the context of terms in a linear model extracted from a lm/mlm object. means.mlm <-
2007 Sep 12
0
constructing an lm() formula in a function
I'm working on some functions for generalized canonical discriminant analysis in conjunction with the heplots package. I've written a candisc.mlm function that takes an mlm object and computes a candisc object containing canonical scores, coeficients, etc. But I'm stumped on how to construct a mlm for the canonical scores, in a function using the *same* right-hand-side of the model
2018 Jul 20
0
Should there be a confint.mlm ?
>>>>> steven pav >>>>> on Thu, 19 Jul 2018 21:51:07 -0700 writes: > It seems that confint.default returns an empty data.frame > for objects of class mlm. For example: > It seems that confint.default returns an empty data.frame for objects of > class mlm. Not quite: Note that 'mlm' objects are also 'lm' objects, and so it is
2005 May 09
0
Sampling from multivariate multiple regression prediction regions
I'd like to sample multiple response values from a multivariate regression fit. For example, suppose I have m=2 responses (y1,y2) and a single set of predictor variables (z1,z2). Each response is assumed to follow its own regression model, and the error terms in each model can be correlated (as in example 7.10 of section 7.7 of Johnson/Wichern): > ex7.10 <- + data.frame(y1 =
2012 Nov 14
2
aggrete data from combination
Dear R users, A have a dataframe (matrix) with two collumns (plot, and diameter (d)). I want all diameters values for different combination of plots. For example I want all d values for all posible combination, 100C2 (all d values for plot 1 with all d values in the plot 2.......with all d values from plot 1 with all d values from plot 100, ...... with all d values from plot 99 with all d values
2016 Apr 15
0
aggregate combination data
Hello, I'm cc'ing R-Help. Sorry but your question was asked 3.5 years ago, I really don't remember it. Can you please post a question to R-Help, with a reproducible example that describes your problem? Rui Barradas ? Citando catalin roibu <catalinroibu at gmail.com>: > Dear Rui, > ? > I helped me some time ago with a code..... regarding aggregated data >
2006 Jul 18
3
Test for equality of coefficients in multivariate multiple regression
Hello, suppose I have a multivariate multiple regression model such as the following: > DF<-data.frame(x1=rep(c(0,1),each=50),x2=rep(c(0,1),50)) > tmp<-rnorm(100) > DF$y1<-tmp+DF$x1*.5+DF$x2*.3+rnorm(100,0,.5) > DF$y2<-tmp+DF$x1*.5+DF$x2*.7+rnorm(100,0,.5) > x.mlm<-lm(cbind(y1,y2)~x1+x2,data=DF) > coef(x.mlm) y1 y2 (Intercept)
2005 Feb 18
0
Suggestions for enhanced routines for "mlm" models.
Dear R-devel'ers Below is an outline for a set of routines to improve support for multivariate linear models and "classical" repeated measurements analysis. Nothing has been coded yet, so everything is subject to change as loose ideas get confronted by the harsh realities of programming. Comments are welcome. They might even influence the implementation... -pd General
2008 Apr 03
3
summary(object, test=c("Roy", "Wilks", "Pillai", ....) AND ellipse(object, center=....)
Dear All, I would be very appreciative of your help with the following 1). I am running multivariate multiple regression through the manova() function (kindly suggested by Professor Venables) and getting two different answers for test=c("Wilks","Roy","Pillai") and tests=c("Wilks","Roy",'"Pillai") as shown below. In the
2018 Jul 20
3
Should there be a confint.mlm ?
It seems that confint.default returns an empty data.frame for objects of class mlm. For example: ``` nobs <- 20 set.seed(1234) # some fake data datf <- data.frame(x1=rnorm(nobs),x2=runif(nobs),y1=rnorm(nobs),y2=rnorm(nobs)) fitm <- lm(cbind(y1,y2) ~ x1 + x2,data=datf) confint(fitm) # returns: 2.5 % 97.5 % ``` I have seen proposed workarounds on stackoverflow and elsewhere, but
2012 Oct 30
2
error in lm
Hi everybody I am trying to run the next code but I have the next problem Y1<-cbind(score.sol, score.com.ext, score.pur) > vol.lm<-lm(Y1~1, data=vol14.df) > library(MASS) > stepAIC(vol.lm,~fsex+fjob+fage+fstudies,data=vol14.df) Start: AIC=504.83 Y1 ~ 1 Error in addterm.mlm(fit, scope$add, scale = scale, trace = max(0, trace - : no addterm method implemented for
2017 Apr 04
0
Some "lm" methods give wrong results when applied to "mlm" objects
I had a look at some influence measures, and it seems to me that currently several methods handle multiple lm (mlm) objects wrongly in R. In some cases there are separate "mlm" methods, but usually "mlm" objects are handled by the same methods as univariate "lm" methods, and in some cases this fails. There are two general patterns of problems in influence measures:
2006 Jul 19
1
Test for equality of coefficients in multivariate multipleregression
Dear Berwin, Simply stacking the problems and treating the resulting observations as independent will give you the correct coefficients, but incorrect coefficient variances and artificially zero covariances. The approach that I suggested originally -- testing a linear hypothesis using the coefficient estimates and covariances from the multivariate linear model -- seems simple enough. For
2005 Aug 16
2
quirky behavior from rbinom (PR#8071)
Full_Name: Chris Paulse Version: 2.1.1 OS: WinXP Submission from: (NULL) (129.98.60.134) This seems strange. I have a small block of code that repeatedly calls rbinom. I put a break in there in case it returns NaN, as I've been having problems with this. Here is a transcript from the debug session: Browse[1]> theP [1] 1 Browse[1]> yleft[dataIndex] [1] 3 Browse[1]> rbinom(1,3,1)
2012 Feb 09
1
passing an extra argument to an S3 generic
I'm trying to write some functions extending influence measures to multivariate linear models and also allow subsets of size m>=1 to be considered for deletion diagnostics. I'd like these to work roughly parallel to those functions for the univariate lm where only single case deletion (m=1) diagnostics are considered. Corresponding to stats::hatvalues.lm, the S3 method for class
2010 Jul 29
0
[R-pkgs] heplots 0.9-3 and candisc 0.5-18 released to CRAN
I've just released the latest R-Forge versions of heplots 0.9-3 and candisc 0.5-18 to CRAN. They should appear there within a day or two. == heplots The heplots package provides functions for visualizing hypothesis tests in multivariate linear models (MANOVA, multivariate multiple regression, MANCOVA, etc.). They represent sums-of-squares-and-products matrices for linear hypotheses and for
2006 Jul 19
1
Bug?: summary() fails after use of na.action="na.exclude" in lm()
Hello! I have encountered a weird problem and I am wondering if this is a bug. Here is the example: n <- 50 x <- runif(n=n) y1 <- 2 * x + rnorm(n=n) y2 <- 5 * x + rnorm(n=n) y2[sample(1:n, size=5)] <- NA y <- cbind(y1, y2) fit <- lm(y1 ~ 1, na.action="na.exclude") summary(fit) ## Goes ok here fit <- lm(y2 ~ 1, na.action="na.exclude") summary(fit)
2008 May 30
1
robust mlm in R?
I'm looking for something in R to fit a multivariate linear model robustly, using an M-estimator or any of the myriad of other robust methods for linear models implemented in robustbase or methods based on MCD or MVE covariance estimation (package rrcov). E.g., one can fit an mlm for the iris data as: iris.mod <- lm(cbind(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) ~ Species,