[R] lavaan and semTools warning message

2013-04-29 Thread Duarte Viana
Hello all, I am running a simple path analysis with the function sem.mi (of semTools) after doing multiple imputation in my (missing) data. However, depending on the option to combine the chi-square, I get the following warning messages: Warning messages: 1: In estimateVCOV(lavaanModel, samplesta

[R] Multiple imputed data and variable selection / significance

2012-11-12 Thread Duarte Viana
Hello all, I used the MICE procedure (of package "mice") to impute a dataset (I got m imputed datasets). Now I would like to fit a GLM with a poisson error distribution to regress a count variable on 14 continuous predictor variables and test for the significance of the different predictors by me

[R] Error in if (rank) { : argument is not interpretable as logical

2012-06-11 Thread Duarte Viana
Hello all, I am running the function "rda" of the vegan library, like I did many times without having troubles, and I get the following error message: "Error in if (rank) { : argument is not interpretable as logical". I am just testing a response matrix against a single explanatory matrix, which

[R] problem with function "Truncate" in package "distr"

2011-09-21 Thread Duarte Viana
ion(Lnorm(3.2,0.5),Lnorm(5.4,0.6),mixCoeff=c(0.3,0.7)) mix.trunc<-Truncate(mix,lower=0.001,upper=3000) distr.sample<-r(mix.trunc)(100) range(distr.sample) Why do I get values over 3000 (which was the defoned upper limit)? Some help would be greatly appreciated. Dua

Re: [R] Latin Hypercube Sampling with a condition

2011-06-02 Thread Duarte Viana
at 7:06 PM, Rob Carnell wrote: > Duarte Viana gmail.com> writes: > >> >> Thanks Rob and Ravi for the replies. >> >> Let me try to explain my problem. I am trying to make a kind of >> sensitivity analysis where I have 5 parameters (the margins of the >>

[R] Latin Hypercube Sampling with a condition

2011-06-02 Thread Duarte Viana
Thanks Rob and Ravi for the replies. Let me try to explain my problem. I am trying to make a kind of sensitivity analysis where I have 5 parameters (the margins of the Latin hypercube), 3 of them are proportions that should sum to one. My idea is to obtain uniform combinations of the 3 proportion-

[R] Latin Hypercube Sampling with a condition

2011-05-31 Thread Duarte Viana
Hello all, I am trying to do a Latin Hypercube Sampling (LHS) to a 5-parameter design matrix. I start as follows: library(lhs) p1<-randomLHS(1000, 5) If I check the distribution of each parameter (column), they are perfectly uniformly distributed (as expected).For example, hist(p1[,1]) Now th

[R] package "sensitivity" - sobol2002 indices

2011-04-18 Thread Duarte Viana
b 0.4323300 -0.004814019 0.2692777 -0.1669219 1.0103819 What am I doing wrong? Or the approach has some limitation that I might be disregarding? Thanks for any clarification on this. Duarte Viana __ R-help@r-project.org mailing list https://stat.eth

[R] extract printed value from a function

2011-02-24 Thread Duarte Viana
Maechler wrote: >>>>>> "PE" == Peter Ehlers >>>>>>     on Thu, 24 Feb 2011 07:07:29 -0800 writes: > >    PE> On 2011-02-24 06:32, David Winsemius wrote: >    >> >    >> On Feb 24, 2011, at 7:22 AM, Peter Ehlers wrote: >

[R] extract printed value from a function

2011-02-24 Thread Duarte Viana
Hello all, This shouldn't be difficult, but I am not able to extract a printed value from a function and assign it to an object. In my case, > library(DAAG) > twotPermutation(c(2,3,4),c(3,6,5),plotit=F) [1] 0.298 I would like to assign this result to an object. Thanks, Duarte ___

[R] line type in plots of the "ade4" package

2011-02-18 Thread Duarte Viana
Hello all, In package "ade4", does anyone know whether there is a simple way of setting the line type for the ellipses in an s.class plot? The argument "lty" does not work. Thanks, Duarte __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

[R] CART with a circular response

2010-07-15 Thread Duarte Viana
Hello all, Could anyone advise me how can I implement classification and regression tree analyses for a circular response (angles)? Is there available R code or I would have to adapt code from "rpart" or "tree" libraries, which I am not sure would be able to do it? I would really appreciate any

[R] y-axis log scale in library lattice

2010-04-30 Thread Duarte Viana
Hello all, Is there an argument in function "xyplot" (library "lattice") equivalent to log="y" in base graphics? I mean transforming the axis, not the variable, as the help on argument log in"scales" says "Note that this is a transformation of the dat

[R] plot with personalized axes

2010-04-28 Thread Duarte Viana
to use a y-scale in which each "unity" increases 10-fold from the previous one. Say, a scale 10^n, where n=1,2,3... (equally spaced). For example, c(0.1,0.0001,0.001,0.01,0.1,1) equally spaced on the y-axis. Some advice on that would be greatly appreciated.

[R] Sequence of ordered variable to add as column

2010-03-19 Thread Duarte Viana
ot;id", resulting in this dataframe: > seq.id<-c(1,2,3,1,2) > df$seq.id<-seq.id id ord dates seq.id 3 a 1 1992-01-14 1 5 a 2 1992-02-01 2 4 a 3 1992-02-28 3 1 b 2 1992-02-27 1 2 b 1 1992-02-27 2 Thanks in advance, Duarte Viana __

[R] Reshape dataframe according to ordered variables

2010-03-18 Thread Duarte Viana
;a","a","a","b","b"),ord=c(1,2,3,1,2)) id ord 1 a 1 2 a 2 3 a 3 4 b 1 5 b 2 Thanks in advance, Duarte Viana __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

[R] Posterior use of iterations output in a for() loop

2009-08-18 Thread Duarte Viana
;9") to make an histogram. I could just copy and paste them, but I want to do this with thousands of vectors (each one resulting from an iteration, which can be a vector of potential enormous length). I would really appreciate some help. Thanks, Duarte Viana __

[R] R-squared of a distribution fitting

2009-08-10 Thread Duarte Viana
Hello, I am fitting a parameterized log-normal distribution to a sample distribution (pdf). I am using the function "fitdistr" in package MASS to calculate the distribution parameters according to the maximum likelihood procedure and test for the goodness of fit using a chi-squared test (as I have