search for: hetcor

Displaying 20 results from an estimated 38 matches for "hetcor".

Did you mean: hector
2006 Dec 01
3
error in hetcor function (polycor package)?
I have been using the hetcor function in the polycor package. When I don't specify the use option everything runs smoothly. However, when I specify use either as "pairwise.complete.obs" or "complete.obs" I get this error Error in optim(rho, f, control = control, hessian = TRUE, method = "BFGS&q...
2012 Nov 16
1
polycor package
...tried to copy and paste the code from the sem.pdf file using data from CNES but I still get an error message. Any help would be much appreciated. > germany2009 <- read.dta("StataforR.dta") > #attach(germany2009) > viewData(germany2009) > # > hcor <- function(data) hetcor(data, std.err=F, pd=T)$correlations > hetcor=hcor(germany2009) > hetcor cdupid MERKELLIKE CDULIKE MERKELPROX CDUPROX cdupid 1.0000000 0.5073577 0.6070514 -0.4064925 -0.4146810 MERKELLIKE 0.5073577 1.0000000 0.7832340 -0.4405571 -0.4200360 CDULIKE 0.6070514...
2010 Jan 03
1
Questions regarding sem using hetcor() function from polycor and diagrams
...were answered in the past. I also recognize that one of my questions unfortunately verges on statistical rather than code territory. I have two rather unrelated questions about using the sem and polycor packages for a relatively simple confirmatory path analysis: (1) My data requires using the hetcor function from the polycor package, and I ran the sem() function using a matrix from this code: hcor<-function(data) hetcor(data,std.err=FALSE,use="pairwise.complete.obs")$correlations I believe this means I am using a correlation rather than a covariance matrix for the model fit s...
2012 Jan 24
0
PCA for assets based household income analysis (" hetcor" and "princomp")
...ario 1 If i only use PCA without using&nbsp;polychoric correlation assets.pca &lt;- princomp(covmat = assets, scores=T) assets$income&lt;-predict(assets2.pca)[,1] # these predict the&nbsp;coefficient&nbsp;for &nbsp;income for each observation Scenario 2 but when i run "hetcor" (for&nbsp;polychoric correlation coefficient) , and then&nbsp;princomp (for&nbsp;PCA) and finally predict ( to&nbsp;&nbsp;predict the&nbsp;coefficient&nbsp;for income for each observation). hetcor and princomp runs fine but predict command&nbsp;doesn't&...
2012 Mar 26
0
SEM: Dependent binary: impact estimating wrong standard errors with hetcor()
Hi, I'm using the SEM package to estimate a model with a binary variabele as dependent variable. In the literature I have to use then the correlation matrix, made by function hetcor(). Literature also says that the standard errors are not correct then. My question is if somebody knows what the impact is on the estimated coefficients. If I want to calculate the estimated probability I see a large difference if I'm using the covariance-matrix of the correlation-matrix. And I...
2008 Aug 07
2
Problems using hetcor (polycor)
Sorry if this post should be long but I tried to give you a piece of my data to reproduce my error message using hetcor: Fehler in result$rho : $ operator is invalid for atomic vectors Zus?tzlich: Warning messages: 1: In polychor(x, y, ML = ML, std.err = std.err) : 1 row with zero marginal removed 2: In polychor(x, y, ML = ML, std.err = std.err) : the table has fewer than 2 rows Error in result$rho : $ operat...
2013 Jan 23
2
CFA with lavaan or with SEM
...tive variances (-0.002) which I think is due to the correlation matrix not being positive definite. Is it reasonable to force these to be zero when defining the model or is this more a sign of problems with the model? As an alternative is it possible to calculate the tetrachoric correlations using hetcor (which applies smoothing) and then use the smoothed sample correlation as the input to the model, such as fit.cor <- cfa(model.1, sample.cov=my.hetcor, sample.nobs=300, std.lv = T,estimator="ML", ordered=c("var1","var2" and so on for the other 23 variables)). This...
2023 Feb 22
1
MFA variables graph, filtered by separate.analyses
Dear gavin, I think that it's likely that Jim meant the hetcor() function in the polycor package. Best, John -- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada web: https://socialsciences.mcmaster.ca/jfox/ On 2023-02-21 5:42 p.m., gavin duley wrote: > Hi Jim, > > On Tue, 21 Feb 2023 at 22:17, Jim Lemon <drjimlemon...
2008 Sep 01
1
Polychoric and tetrachoric correlation
Hi there, Am I correct to believe that tetrachoric correlation is a special case of polychoric correlation when there are only two levels to the ordered factor? Thus it should be okay to use hetcor from the polycor package to build a matrix of correlations for binary variables? If this is true, how can one estimate 95% confidence intervals for the correlations? My guess would be mat = hetcor(dataframe) mat$correlation - (1.96 * mat$std.errors) mat$correlation + (1.96 * mat$std....
2009 May 20
1
sem with categorical data
I am trying to run a confirmatory factor analysis using the SEM package. My data are ordinal. I have read http://socserv.mcmaster.ca/jfox/Misc/sem/SEM-paper.pdf. When I apply the hetcor function, I receive the following error: Error in checkmvArgs(lower = lower, upper = upper, mean = mean, corr = corr, : at least one element of 'lower' is larger than 'upper' Example: set.seed(781) q1 <- cut2(x = rlnorm(n = 1e2, m = 2), cuts = seq(1,6)) q2 <- cut2(x = rlno...
2009 Jan 12
3
polychoric correlation: issue with coefficient sign
Hello, I am running polychoric correlations on a dataset composed of 12 ordinal and binary variables (N =384), using the polycor package. One of the association (between 2 dichotomous variables) is very high using the 2-step estimate (0.933 when polychoric run only between the two variables; but 0.801 when polychoric run on the 12 variables). The same correlation run with ML estimate returns a
2007 Oct 29
1
biserial correlation with pkg polycor
Een ingesloten tekst met niet-gespecificeerde tekenset is van het bericht gescrubt ... Naam: niet beschikbaar Url: https://stat.ethz.ch/pipermail/r-help/attachments/20071029/b29e9bd5/attachment.pl
2006 Jan 19
0
Editing Partial Correlation Matrix
Hi, I created a matrix of correlation coefficients and their respective scatterplots using the commands hetcor() and panel.cor(). Can I edit this matrix? I would like to have the scale values display at the top, as opposed to the alternating top-bottom scale approach. Also, I would like to increase the font size of the graphic for print purposes. Any help on how to accomplish this would be greatly appre...
2017 Sep 02
0
correlation between nominal and ordinal
hi merlin, Check out the hetcor package. Jim On Sat, Sep 2, 2017 at 6:25 AM, <merlinverdecia at infomed.sld.cu> wrote: > I would be very grateful if you would tell me how I can find the degree of > correlation between a nominal dependent variable and an independent ordinal > variable. The nominal variable has o...
2023 Feb 21
1
MFA variables graph, filtered by separate.analyses
Hi Gavin, I can't work through this right now, but I would start by looking at the 'hetcor' package to get the correlations, or if they are already in the return object, build a plot from these. Jim On Wed, Feb 22, 2023 at 4:24 AM gavin duley <gduley at gmail.com> wrote: > > Hi! > > Apologies if this is not the correct place to ask. I am attempting a > MFA anal...
2011 Feb 14
4
sem problem - did not converge
...<-> F2, F1F2, NA F1 <-> F3, F1F3, NA F1 <-> F4, F1F4, NA F1 <-> F5, F1F5, NA F2 <-> F3, F2F3, NA F2 <-> F4, F2F4, NA F2 <-> F5, F2F5, NA F3 <-> F4, F3F4, NA F3 <-> F5, F3F5, NA F4 <-> F5, F4F5, NA ###i tryed several correlations, such as hetcor and polychor of polycor library hcor <- function(data) hetcor(data, std.err=FALSE)$correlations hetdados40=hcor(dados40) dados40.sem <- sem(model.dados40, dados40.cov, nrow(dados40)) Warning message: In sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = vars, : Could...
2017 Sep 01
4
correlation between nominal and ordinal
I would be very grateful if you would tell me how I can find the degree of correlation between a nominal dependent variable and an independent ordinal variable. The nominal variable has only two levels: YES and NO. thank you very much in advance regards, merlin ---------------------------------------------------------------- -- Este mensaje le ha llegado mediante el servicio de correo
2008 Nov 03
1
Input correlation matrix directly to princomp, prcomp
...e grateful for any help. I want to do a principal components analysis directly on a correlation matrix object rather than inputting the raw data (and specifying cor = TRUE or the like). The reason behind this is I need to use polychoric correlation coefficients calculated with John Fox's hetcor function. Is there a way to do this with princomp or prcomp, or any other principal components function in other R packages? Again, very grateful for any help. David Evans. [[alternative HTML version deleted]]
2009 Jan 30
1
Factor Analysis-factanal function
Dear friends, I'm using R to produce the following Factor Analysis: > matriz.cor<-hetcor(matrix(as.factor(data), ncol=variables, byrow=T))$correlations > factanal(x=data, factors=2, covmat=matriz.cor, scores='regression') Then the screen output shows the following message: Error en factanal(x = data, factors = 2, covmat = matrix, : requested scores without an ...
2009 Feb 02
1
Fit indexes in SEM with categorical data + ML estimation
...ata. Psychological Methods, 9(4), 466-491). Standard errors can be dealt with by using bootstrap estimations. But, I was wondering how the fit indexes in the SEM package were estimated when the observed variables are categorical (ordinal or/and binary) and when one is using polychoric correlation (hetcor in polycor package) in combination with ML. Does SEM use the Satorra-Bentler rescaled Chi-square for instance? I look in previous posts but couldn't find what i am looking for (hope i looked well enough!). Cheers, Dorothee -- View this message in context: http://www.nabble.com/Fit-indexes-i...