Re: [R] Calculation of VCV matrix of estimated coefficient

2024-09-04 Thread Ben Bolker
The number you need for MSE is sum(residuals(model)^2)/df.residual(model) On Wed, Sep 4, 2024 at 3:34 PM Daniel Lobo wrote: > > Hi, > > I am trying to replicate the R's result for VCV matrix of estimated > coefficients from linear model as below > > data(mtcars) > model <- lm(mpg~disp+hp, data=m

[R] Calculation of VCV matrix of estimated coefficient

2024-09-04 Thread Daniel Lobo
Hi, I am trying to replicate the R's result for VCV matrix of estimated coefficients from linear model as below data(mtcars) model <- lm(mpg~disp+hp, data=mtcars) model_summ <-summary(model) MSE = mean(model_summ$residuals^2) vcov(model) Now I want to calculate the same thing manually, library(

Re: [R] dotchart and dotplot(lattice) plot with two/three conditioning variables

2024-09-04 Thread Deepayan Sarkar
For lattice::dotplot(), you are close; this is more like the layout you want: dotplot(Year ~ ptile | reorder(Population, ptile, mean), testLong, groups = c("0-50", "50-90", "90-100")[time], layout = c(1, NA), par.settings = simpleTheme(pch = 16), auto.key = TRUE) dotchart(

[R] dotchart and dotplot(lattice) plot with two/three conditioning variables

2024-09-04 Thread Anupam Tyagi
Hello, I am trying to make a Cleaveland Dotplot with two, if possible three, variables on the vertical axis. I was able to do it in Stata with two variables, Year and Population (see graph at the link: https://drive.google.com/file/d/1SiIfmmqk6IFa_OI5i26Ux1ZxkN2oek-o/view?usp=sharing ). I hope the

Re: [R] fixed set.seed + kmeans output disagree on distinct platforms

2024-09-04 Thread Iago Giné Vázquez
Thanks both Bert and Martin, However exkmns2$centers is common in posit.cloud - LAPACK version 3.9.0- and in Windows -LAPACK 3.12.0-, while distinct with my Linux settings -LAPACK version 3.11.0- (I don't know the BLAS version used by R in windows). It is a bit strange... Iago

Re: [R] fixed set.seed + kmeans output disagree on distinct platforms

2024-09-04 Thread Martin Maechler
> Bert Gunter > on Tue, 3 Sep 2024 23:32:25 -0700 writes: > I have no clue, but I did note that you are using different versions of > BLAS/LAPACK on the different platforms. Could that be (part) of the issue? Good catch! My gut feeling would say "yes!" that is almost surely