If you have 2 dichotomous variables coded 0/1 (and stored as numerics)
then the var and cov functions can be used to compute the covariance
as if they were continuous variables. Some algebra shows that the
continous covariance and the binomial covariance only differ by the
denominator (n for binom
Hi,
I am trying to test a mediation hypothesis using coefficients from logistic
regression analyses (x, m, and y are all dichotomous). I am running a test
of significance using MacKinnon and Dwyer's adaptation of Sobel's test
(i.e., correcting for different scales of coefficients in cases of a
dic
On 07/30/2012 11:00 PM, Luna wrote:
Dear R users,
I have a hard time interpreting the covariances in the parameter estimates
output (standardized), even in the example documented (PoliticalDemocracy).
Can anyone tell me if the estimated covariances are residual covariances
(unexplained by the mod
Dear R users,
I have a hard time interpreting the covariances in the parameter estimates
output (standardized), even in the example documented (PoliticalDemocracy).
Can anyone tell me if the estimated covariances are residual covariances
(unexplained by the model), or the covariances of the obser
This bit helped me to match lme results in R with SAS, try
options(contrasts=c("contr.sum","contr.poly"))
before lme model.
--
View this message in context:
http://r.789695.n4.nabble.com/Covariance-structure-for-lme-tp4630413p4635005.html
Sent from the R help mailing list archive at Nab
Dear R help forum members,
I am modeling a gaussian distribution for a computational biology application
and I am working in the statistical package "R". In this regard, my problem is
that I have to construct a covariance matrix with variables (non-numeric) and
the covariance matrix is to be us
Greetings again R users,
Some of you will likely recognize me but I hope you can help me once
more. I have tried the mixed model mailing list for this question but have
yet to find a solution. As such I hope someone will have another idea.
I have previously attempted to replicate the UN, CS, an
On Fri, Feb 17, 2012 at 11:06:23PM +0300, Naser Albalwi wrote:
>
> Thank, thats what I need, using> the built-in help system and R's capability
> to allow you to view source code for functions, but how???
Hi.
First, type "cov" without quotation marks to R's prompt. The
printed code calls .Int
could you help with example ??
--
View this message in context:
http://r.789695.n4.nabble.com/covariance-tp4398242p4398470.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/l
Thank, thats what I need, using> the built-in help system and R's capability to
allow you to view source code for functions, but how???
> Date: Fri, 17 Feb 2012 14:55:10 -0500
> Subject: Re: [R] covariance
> From: sarah.gos...@gmail.com
> To: nasser-d2...@hotmai
On Feb 17, 2012, at 2:36 PM, Ali2006 wrote:
can any one please tell me how can I Compute the covariance matrix
of (Y)
which is 5 variables .. without using a built-in function??
2) how (cov) works ( I need to get the details for this function ???
http://cran.r-project.org/doc/Rnews/
This sounds remarkably like homework. You can address your own issue using
the built-in help system and R's capability to allow you to view source code
for functions, but we can't help you do your assignments.
Sarah
On Fri, Feb 17, 2012 at 2:36 PM, Ali2006 wrote:
> can any one please tell me how
n...@r-project.org] On
> Behalf Of Ali2006
> Sent: Friday, February 17, 2012 2:37 PM
> To: r-help@r-project.org
> Subject: [R] covariance
>
> can any one please tell me how can I Compute the covariance matrix of (Y)
> which is 5 variables .. without using a built-in function??
can any one please tell me how can I Compute the covariance matrix of (Y)
which is 5 variables .. without using a built-in function??
2) how (cov) works ( I need to get the details for this function ???
--
View this message in context:
http://r.789695.n4.nabble.com/covariance-tp439824
I am applying a hidden markov model on joint multivariate gaussian
distribution for 2 vectors. I am using the depmixS4 package in R.
Specifically, I am using the following code:
mod<-depmix(list(response = mom ~ mkt + p0 + p1, mkt~1), data = regvar,
nstates = 2,
family = list(gaussian(), gaussia
That's very helpful Michael, thank you. I will add it to the arsenal.
--
View this message in context:
http://r.789695.n4.nabble.com/Covariance-Variance-Matrix-and-For-Loops-tp3859441p3863098.html
Sent from the R help mailing list archive at Nabble.com.
_
Surprising: must be newer update than I realizedanyways, here's
the code if you want to add it manually:
simplify2array <-
function (x, higher = TRUE)
{
if (length(common.len <- unique(unlist(lapply(x, length >
1L)
return(x)
if (common.len == 1L)
unlist(x,
Hello again,
sapply works.
However it does not explicitly call a simplify function, but rather seems to
handle the case within its own body of code. I should be able to figure out
basically what simplify2array does from the code though.
function (X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE)
I don't have access to older versions of R right now, but if you have a recent
install you are probably running 2.13.1 or 2.13.0. Can you run the following:
X <- list(a= rnorm(5), b= rnorm(5))
sapply(X, min)
?
sapply calls simplify2array() so if this works take a look at the code for
sapply (j
Thank you Michael.
I think my initial problem may have been due to a 'clerical error' upriver,
so I appreciate you taking the time to give me this help.
Unfortunately, my version of R does not contain simplify2array() and does
not find it in help (?simplify2array) - which is strange because I jus
Without seeing cvm1_list, I can't guarantee this will work, but consider this:
testList = list(rnorm(500), rnorm(500), rnorm(500), rnorm(500), rnorm(500))
testMat = simplify2array(testList)
covTest = cov(testMat)
Running your code works on my testList, so I can't help there without
a reproducible
Hello,
I am very new to R (as my Subject probably indicates).
I want to do something that should, I think, be very simple. I have five
vectors in a list and I want to construct a covariance matrix out of them.
Given a 5X5 matrix cvm1, and the list of vectors, cvm1_list, I thought the
following w
On 2011-07-03 04:48, osama hussien wrote:
The backage lmoments computes the L-moments covariances. does anyone
know a backage to compute
the TL-moments covariances
thank
As far as I know the answer is no. But if you study the code of
function varLmoments in package nsRFA and see how closely th
The backage lmoments computes the L-moments covariances. does anyone
know a backage to compute
the TL-moments covariances
thank
--
Osama Abdelaziz Hussien
Department of Statistics
Faculty of Commerce
Alexandria University
Egypt
__
R-help@r-project.org
Let me clarify the output I want to create:
Source X1 (var) X2 (var) X1&X2
(cov)
gen var(X1) var(X2)
cov(x1X2)
block var(X1) var(X2)
cov(x1x2)
error/ res var(
Dear list
I need your help: Execuse me for my limited R knowledge.
#example data set
set.seed (134)
lm=c(1:4)
block = c(rep(lm,6))
gen <- c(rep(1, 4), rep(2, 4), rep(3, 4), rep(4, 4),rep(5, 4),rep(6, 4))
X1 = c( rnorm (4, 10, 4), rnorm (4, 12, 6), rnorm (4, 10, 7),rnorm (4, 5, 2),
rnorm (4, 8,
Hi all,
I generated a covariance matrix and visualized as a 2D contour plot (x,y,
covariance matrix), I would like to extract from the matrix the values ( in
x and y) that auto-correlate which I will plot as an normal (x,y(being the
values that auto-corelate to a certain x and y values in my origi
Unintelligible -- to me anyway. You will have to explain what you mean
more explicitly and with greater clarity -- at least for my feeble
mind-- to get help.
-- Bert Gunter
On Fri, Oct 22, 2010 at 11:01 AM, Marcelo Lima wrote:
> Dear all,
>
> I generated a covariance matrix and I would like to g
Dear all,
I generated a covariance matrix and I would like to generate a 1D plot of
the data that auto-correlate. any suggestions?
Thanks,
Marcelo
--
Marcelo Andrade de Lima
UNIFESP - Universidade Federal de São Paulo
Departamento de Bioquímica
Disciplina de Biologia Molecular
Rua Três de Maio
Dear all,
I'm using R function "glmmPQL" in "MASS" package for generalized linear mixed
model considering the temporal correlations in random effect. There are 1825
observations in my data, in which the random effect is called "Date", and there
are five levels in "Date", each repeats 365 times
R-Help,
I been using nlme to fit a model with 2 random effects. The correlation
matrix I get with the VarCorr command does not seem to have the correct
value for the correlation entry. E.g., below is a VarCorr matrix of random
effects from data that I am working on:
Variance StdDev
Depending upon the size of the matrix, using:
diag(cov(t(x), t(y)))
might be notably faster. On smaller matrices the time savings is
negligible.
Using Jorge's example below:
> diag(cov(t(X), t(Y)))
[1] 0.23396819 0.51455839 1.13851842 -4.30551345 -2.60720372
[6] -0.06834326 0.783441
Dear Benny,
Here is something that could get you a hint:
# Some data
set.seed(123)
X <- matrix(rnorm(100),ncol=10)
Y <- matrix(rnorm(100,2,4),ncol=10)
# Number of rows
n<-nrow(X)
# Covariances
sapply(1:n,function(i) cov(X[i,],Y[i,]))
# [1] 0.23396819 0.51455839 1.13851842 -4.30551345 -2.60720
sapply(seq_len(nrow(x)), function(i) var(x[i,], y[i,]))
Gabor
On Sun, Apr 19, 2009 at 7:12 PM, Benny Chain wrote:
> Does anyone know a way to calculate the covariances between two
> arrays/matrices x and y, row by row. i.e. var(x[n,],y[n,]) for all n ?
>
> Benjamin Chain
> Division of Infection
Does anyone know a way to calculate the covariances between two
arrays/matrices x and y, row by row. i.e. var(x[n,],y[n,]) for all n ?
Benjamin Chain
Division of Infection and Immunity
Windeyer Building
UCL, 46 Cleveland St.
London W1T 4JF
Fax 00 44 20 7679 9301
__
I have fit a model with a more complex covariance structure, but the fit
reports a false convergence. I have read from past posts that this can be an
indication of over-specification. I went ahead and fit a model with a simpler
covariance structure. It doesn't seem like I can compare the two
Just interchange rows 2 and 3 and then columns 2 and 3 of the original
covariance matrix.
--- On Fri, 8/8/08, Zhang Yanwei - Princeton-MRAm <[EMAIL PROTECTED]> wrote:
> From: Zhang Yanwei - Princeton-MRAm <[EMAIL PROTECTED]>
> Subject: [R] Covariance matrix
> To:
Hi all,
Assume I have a random vector with four variables, i.e. A=(a,b,c,d). I am
able to get the covariance matrix of vector A, but how can I get the covariance
matrix of vector B=(a,c,b,d) by manipulating the corresponding covariance
matrix of A? Thanks.
Sincerely,
Yanwei Zhang
Department
Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of A. Beaujean
> Sent: Monday, October 29, 2007 4:25 PM
> To: Peter B. Mandeville
> Cc: r-help
> Subject: Re: [R] covariance matrix of the regression coefficients
>
> If X is your p-1 variable matrix (with
If X is your p-1 variable matrix (with the first column vector being 1s),
i.e., nrow(X)=n and ncol(X)=p
then
MSE<-summary(lm(Y~X[2]+X[3] + ...X[P-1]))$s^2
and your coefficient (co)variance matrix is
MSE*ginv(t(X)%*%X)
Best,
Alex
On 10/29/07, Peter B. Mandeville <[EMAIL PROTECTED]> wrote:
>
>
Dear Peter,
See ?vcov. You could have discovered this via
help.search("covariance").
I hope this helps,
John
On Mon, 29 Oct 2007 11:30:11 -0600
"Peter B. Mandeville" <[EMAIL PROTECTED]> wrote:
> Greetings,
>
>
>
> Cohen, Cohen, West, and Aiken 2003 (Applied Multiple
> Regression-Correlatio
Peter B. Mandeville wrote:
> Greetings,
>
>
>
> Cohen, Cohen, West, and Aiken 2003 (Applied Multiple Regression-Correlation
> Analysis for the Behavioral Sciences, Third Edition) on page 273 state the
> covariance matrix of the regression coefficients is provided by standard
> programs for multip
adhan.html
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Peter B. Mandeville
Sent: Monday, October 29, 2007 1:30 PM
To: r-help@r-project.org
Subject: [R] covariance matrix of the regression coefficients
Greetings,
Cohen, Cohen, West, and Aiken 2003 (Applie
See ?vcov .
On Mon, 29 Oct 2007, Peter B. Mandeville wrote:
> Greetings,
>
>
>
> Cohen, Cohen, West, and Aiken 2003 (Applied Multiple Regression-Correlation
> Analysis for the Behavioral Sciences, Third Edition) on page 273 state the
> covariance matrix of the regression coefficients is provided
Greetings,
Cohen, Cohen, West, and Aiken 2003 (Applied Multiple Regression-Correlation
Analysis for the Behavioral Sciences, Third Edition) on page 273 state the
covariance matrix of the regression coefficients is provided by standard
programs for multiple regression, including SAS, SPSS, and S
Greetings,
On page 273, Cohen, Cohen, West, and Aiken (Applied Multiple
Regression/Correlation Analysis for the Behavioral Sciences, Third Edition",
state that the covariance matrix of the regression coefficients is provided by
standard programs for multiple regression, including SAS, SPSS, an
Greetings,
Cohen, Cohen, West, and Aiken 2003 (Applied Multiple Regression-Correlation
Analysis for the Behavioral Sciences, Third Edition) on page 273 state the
covariance matrix of the regression coefficients is provided by standard
programs for multiple regression, including SAS, SPSS, and S
47 matches
Mail list logo