similar to: Use scores from factor analysis and missing values factanal(), napredict(), na.omit()

Displaying 20 results from an estimated 1000 matches similar to: "Use scores from factor analysis and missing values factanal(), napredict(), na.omit()"

2011 Jul 23
2
sum part of a vector
Dear colleagues, I have a data set that looks roughly like this; mydat<-data.frame(state=c(rep("Alabama", 5), rep("Delaware", 5), rep("California", 5)), news=runif(15, min=0, max=8), cum.news=rep(0, 15)) For each state, I'd like to cumulatively sum the value of "news" and make that put that value in cum.news. I'm trying as follows but I get
2010 Dec 10
2
45 Degree labels on barplot? Help understanding code previously posted.
Dear colleagues, i found a line or two of code in the help archives from Uwe Ligges about creating slanted x-labels for a barplot and it works well for my purposes (code below). However, I was hoping someone could explain to me precisely what the code is doing. I'm aware it's invoking the text command, and I know the first ttwo arguments to text are x and y co-ordinates. I'm also
2011 Mar 30
1
sampling design runs with no errors but returns empty data set
Dear colleagues, I'm working with the 2008 Canada Election Studies (http://www.queensu.ca/cora/_files/_CES/CES2008.sav.zip), trying to construct a weighted national sample using the survey package. Three weights are included in the national survey (a household weight, a provincial weight and a national weight which is a product of the first two). In the following code I removed variables with
2012 May 02
0
adding a caption to a mosaic plot?
Dear all: Is there a way to add text to the margins or outer margins of a mosaic plot using the vcd package? I understand the margins argument to mosaic, but I don't know how to add text to that. I'd like to add a caption to a plot. If possible, I'd like to know how to set the font and size for that function as well. My plot looks roughly as below. Thank you for your time! Simon J.
2009 Mar 10
1
Using napredict in prcomp
Hello all, I wish to compute site scores using PCA (prcomp) on a matrix with missing values, for example: Drain Slope OrgL a 4 1 NA b 2.5 39 6 c 6 8 45 d 3 9 12 e 3 16 4 ... Where a,b... are sites. The command > pca<-prcomp(~ Drain + Slope + OrgL, data = t, center = TRUE, scale = TRUE, na.action=na.exclude) works great, and from
2005 Jun 26
0
Factor correlations in factanal
Dear R-devel list members, Ben Fairbank draw it to my attention that factanal() (in the stats package) doesn't report factor correlations for oblique rotations. Looking at the source, I see that factanal also doesn't save the factor-transformation (rotation) matrix from which these correlations can be computed. I've modified the source, attached below, so that the transformation
2006 Aug 11
1
- factanal scores correlated?
Hi, I wonder why factor scores produced by factanal are correlated, and I'd appreciate any hints from people that may help me to get a deeper understanding why that's the case. By the way: I'm a psychologist used to SPSS, so that question my sound a little silly to your ears. Here's my minimal example: *********************************************** v1 <-
2008 Sep 09
1
Addendum to wishlist bug report #10931 (factanal) (PR#12754)
--=-hiYzUeWcRJ/+kx41aPIZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Hi, on March 10 I filed a wishlist bug report asking for the inclusion of some changes to factanal() and the associated print method. The changes were originally proposed by John Fox in 2005; they make print.factanal() display factor correlations if factanal() is called with rotation =
2017 Jun 18
0
R_using non linear regression with constraints
> On Jun 18, 2017, at 6:24 AM, Manoranjan Muthusamy <ranjanmano167 at gmail.com> wrote: > > I am using nlsLM {minpack.lm} to find the values of parameters a and b of > function myfun which give the best fit for the data set, mydata. > > mydata=data.frame(x=c(0,5,9,13,17,20),y = c(0,11,20,29,38,45)) > > myfun=function(a,b,r,t){ > prd=a*b*(1-exp(-b*r*t)) >
2017 Jun 18
0
R_using non linear regression with constraints
I've seen a number of problems like this over the years. The fact that the singular values of the Jacobian have a ration larger than the usual convergence tolerances can mean the codes stop well before the best fit. That is the "numerical analyst" view. David and Jeff have given geometric and statistical arguments. All views are useful, but it takes some time to sort them all out and
2017 Jun 18
0
R_using non linear regression with constraints
I ran the following script. I satisfied the constraint by making a*b a single parameter, which isn't always possible. I also ran nlxb() from nlsr package, and this gives singular values of the Jacobian. In the unconstrained case, the svs are pretty awful, and I wouldn't trust the results as a model, though the minimum is probably OK. The constrained result has a much larger sum of squares.
2020 Oct 17
0
??? is to nls() as abline() is to lm() ?
I haven't followed your example closely, but can't you use the predict() method for this? To draw a curve, the function that will be used in curve() sets up a newdata dataframe and passes it to predict(fit, newdata= ...) to get predictions at those locations. Duncan Murdoch On 17/10/2020 5:27 a.m., Boris Steipe wrote: > I'm drawing a fitted normal distribution over a
2020 Oct 17
2
??? is to nls() as abline() is to lm() ?
I'm drawing a fitted normal distribution over a histogram. The use case is trivial (fitting normal distributions on densities) but I want to extend it to other fitting scenarios. What has stumped me so far is how to take the list that is returned by nls() and use it for curve(). I realize that I can easily do all of this with a few intermediate steps for any specific case. But I had expected
2017 Jun 18
3
R_using non linear regression with constraints
https://cran.r-project.org/web/views/Optimization.html (Cran's optimization task view -- as always, you should search before posting) In general, nonlinear optimization with nonlinear constraints is hard, and the strategy used here (multiplying by a*b < 1000) may not work -- it introduces a discontinuity into the objective function, so gradient based methods may in particular be
2008 Feb 24
1
what missed ----- CART
Hi all, Can anyone who is familar with CART tell me what I missed in my tree code? library (MASS) myfit <- tree (y ~ x1 + x2 + x3 + x4 ) # tree.screens () # useless plot(myfit); text (myfit, all= TRUE, cex=0.5, pretty=0) # tile.tree (myfit, fgl$type) # useless # close.screen (all= TRUE) # useless My current tree plot resulted from above code shows as:
2011 Jan 25
1
Predictions with 'missing' variables
Dear List, I think I'm going crazy here...can anyone explain why do I get the same predictions in train and test data sets below when the second has a missing input? y <- rnorm(1000) x1 <- rnorm(1000) x2 <- rnorm(1000) train <- data.frame(y,x1,x2) test <- data.frame(x1) myfit <- glm(y ~ x1 + x2, data=train) summary(myfit) all(predict(myfit, test) == predict(myfit, train))
2017 Jun 18
3
R_using non linear regression with constraints
I am not as expert as John, but I thought it worth pointing out that the variable substitution technique gives up one set of constraints for another (b=0 in this case). I also find that plots help me see what is going on, so here is my reproducible example (note inclusion of library calls for completeness). Note that NONE of the optimizers mentioned so far appear to be finding the true best
2012 Aug 25
2
Standard deviation from MANOVA??
Hi, I have problem getting the standard deviation from the manova output. I have used the manova function: myfit <- manova(cbind(y1, y2) ~ x1 + x2 + x3, data=mydata) . I tried to get the predicted values and their standard deviation by using: predict(myfit, type="response", se.fit=TRUE) But the problem is that I don't get the standard deviation values, I only
2007 Jul 09
1
factanal frustration!
Hi. It seems that nearly every time I try to use factanal I get the following response: >faa2db1<-factanal(mretdb1,factors=2,method="mle",control=list(nstart=25)) Error in factanal(mretdb1, factors = 2, method = "mle", control = list(nstart = 25)) : unable to optimize from these starting value(s) > In the case cited above, mretdb1 is synthetic data created
2010 Oct 10
1
Create single vector after looping through multiple data frames with GREP
Hello all, I changed the subject line of the e-mail, because the question I''m posing now is different than the first one. I hope that this is proper etiquette. However, the original chain is included below. I've incorporated bits of both Ethan and Brian's code into the script below, but there's one aspect I can't get my head around. I'm totally new to programming