R Functions and User Interface

Posted on
Picture of user. tbrick Joined: 07/31/2009

Ordinal Data Proposal (#2)

I've been talking to Ryne about this, and I think we've put together a fairly reasonable proposal for the user experience for ordinal data.

We welcome comments and suggestions.

A) From the pathy perspective:

Posted on
Picture of user. tbates Joined: 07/31/2009

mxPath

topic for discussing mxPath() function

Posted on
Picture of user. Steve Joined: 07/30/2009

So many AICs, so little time. What's a summary() to do?

There has been an ongoing discussion on both the optimizer forum and the developer's mailing list about which AIC to use. This thread is here to gather the discussion in one place.

Since the major SEM packages differ in the way they calculate AIC, I proposed we print something like:

AIC (Mx)     = -123456
AIC (Amos)   =  654321
AIC (MPlus)  =  234567
AIC (LISREL) =  132435

Let the AIC discussions begin!

Posted on
Picture of user. tbates Joined: 07/31/2009
Posted on
Picture of user. tbates Joined: 07/31/2009

mxAlgebra

For discussion about mxAlgebra()

Posted on
Picture of user. mspiegel Joined: 07/31/2009

Ordinal Data Proposal (#1)

In the interest of moving forward, I have put together a proposal for representing ordinal data in OpenMx. The scope of this proposal shall be limited to ordinal data; further discussion on how to represent other data types in OpenMx shall be released in another forthcoming proposal. Corrections or comments to this proposal are encouraged. Alternative proposals are also encouraged, and should start a new forum topic [Ordinal Data Proposal (#n)].

Posted on
Picture of user. tbates Joined: 07/31/2009

diag() overloading

Hi, I was wanting to get the diagonal of an openmx output matrix and tried "diag()" as shown below with the matrix.

Question: should (can?) we overload "standard" R functions, or is there to be an mxDiag() equivalent?

If the latter, it would be nice if where possible it worked (to parameters) as the {base} library functions do.

I guess that it would be VERY helpful if code like

   a = mxRun(factorModel)
  round(diag(a$S), 2) # worked, i.e, output a matrix rounded to 2 decimal places
> diag(a$S)
Error in y[1L + 0L:(m - 1L) * (n + 1L)] <- x : 
Posted on
Picture of user. tbates Joined: 07/31/2009

provide warning when data includes variables which are not modeled?

The code below grabs the first 6 variables from myFADataRaw as manifest, but then provides the full n=9-variable covariance matrix to the mxModel

It runs, and gives no warning that half the variables are not modelled. Would be very helpful to say
"variables x-y are included in the covariance matrix, but do not appear in your model!"

or something similar?

########## reduction ##########

require(OpenMx)
data(myFADataRaw); myData = myFADataRaw;
manifests = names(myData)[1:6] # Just the first 6
#[1] "x1" "x2" "x3" "x4" "x5" "x6"
latents = c("G")

factorModel = mxModel(

Posted on
Picture of user. tbates Joined: 07/31/2009

mxMatrix defaults

playing with this

> mxMatrix("Stand", cov2cor(matrix(c(10,9,9,15), nrow=2)), name="Y")
Error in row(tmp) :
a matrix-like object is required as argument to 'row/col'
In addition: Warning messages:
1: In if (is.na(nrow)) { :
the condition has length > 1 and only the first element will be used
2: In if (nrow != ncol) { :
the condition has length > 1 and only the first element will be used

Posted on
Picture of user. tbates Joined: 07/31/2009

using mxMatrix

Shouldn't matrices of type "Symm" only take one triangle of data? Otherwise you can do this: run runs fine, but sees asymmetrical values in the matrix

s <- mxMatrix(type="Symm", 3, 3,
c(FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE),
c(1, .9, .8, .8, 1, .8, .8, .8, 1),
c(NA, "free1", "free2", "free1", NA, "free3", "free2", "free3", NA))
s