search for: sumsq

Displaying 14 results from an estimated 14 matches for "sumsq".

Did you mean: sums
2005 Dec 07
1
KMO sampling adequacy and SPSS -- partial solution
...quacy. ## Input should be a data frame or matrix, output is the KMO statistic. ## Formula derived from Hutcheson et al, 1999, ## "The multivariate social scientist," page 224, ISBN 0761952012 ## see <http://www2.chass.ncsu.edu/garson/pa765/hutcheson.htm> ### cor.sq = cor(df)^2 cor.sumsq = (sum(cor.sq)-dim(cor.sq)[1])/2 library(corpcor) pcor.sq = cor2pcor(cor(df))^2 pcor.sumsq = (sum(pcor.sq)-dim(pcor.sq)[1])/2 kmo = sus.cor.ss/(sus.cor.ss+sus.pcor.ss) return(kmo) } Also, for those trying to reproduce the SPSS factor analysis output, (-1 * cor2pcor(cor(yourDataFrame))) wil...
2011 Apr 12
2
Optimzing a nested function
I am trying to optimize a nested function using nlminb. This throws out an error that y is missing. Can someone help me with the correct syntax?? Thank you. test1 <- function(x,y) { sum <- x + y return(sum) } test2 <- function(x,y) { sum <- test1(x,y) sumSq <- sum*sum return(sumSq) } nlminb(start = c(1,1), test2,lower = c(0,0), upper = c(5,5)) -- View this message in context: http://r.789695.n4.nabble.com/Optimzing-a-nested-function-tp3443825p3443825.html Sent from the R help mailing list archive at Nabble.com.
2008 Jul 23
1
Calling LISP programs in R
...mixnew)"; PUT "(flet(( mean(zlist)"; PUT "(setq sum (loop for x in zlist sum x))"; PUT "(setq m (/ sum (length zlist)))))"; PUT '(pprint (list "The mean is:" (mean mixnew))))'; PUT "(flet((var(zlist)"; PUT "(setq sumsq (loop for x in zlist sum (* (- x m) (- x m)))"; PUT "v (/ sumsq (- (length zlist) 1)))))"; PUT "(setq std (sqrt (var mixnew))))"; PUT '(pprint (list "The Standard Deviation is:" std)))'; PUT "(run 500 41 17.5)"; RUN; %xlog(CL); -- View...
2009 Sep 30
1
How to calculate KMO?
...e KMO statistic. ## Formula derived from Hutcheson et al, 1999, ## "The multivariate social scientist," page 224, ISBN 0761952012 ## see <http://www2.chass.ncsu.edu/garson/pa765/hutcheson.htm><http://www2.chass.ncsu.edu/garson/pa765/hutcheson.htm%3E> ### cor.sq = cor(df)^2 cor.sumsq = (sum(cor.sq)-dim(cor.sq)[1])/2 library(corpcor) pcor.sq = cor2pcor(cor(df))^2 pcor.sumsq = (sum(pcor.sq)-dim(pcor.sq)[1])/2 kmo = sus.cor.ss/(sus.cor.ss+sus.pcor.ss) return(kmo) } What is this object "*sus.cor.ss*"?I get errors > sus.cor.ss Error: object "sus.cor.ss" not f...
2005 Sep 09
2
Discrepancy between R and SPSS in 2-way, repeated measures ANOVA
...for each subject were treated as repeated measures. We desire to obtain P values for disease state ("CONDITION"), and the interaction between signal over time and disease state ("CONDITION*TIME"). Using SPSS, the following output was obtained: DF SumSq (Type 3) Mean Sq F value P= COND 3 42861 14287 3.645 0.0355 TIME 1 473 473 0.175 0.681 COND*TIME 3 975 325 0.120 0.947 Error...
2008 Sep 26
2
ANOVA between & within variance
hi, is there an option to calculate the 'within' & 'between' group variances for a simple ANOVA (aov) model (2 groups, 1 trait, normally distr.) ? or do I have to calculate them from the Sum Sq ? thanks for your time and greetings, gregor -- Gregor Rolshausen PhD Student; University of Freiburg, Germany e-mail: gregor.rolshausen at biologie.uni-freiburg.de tel. :
2017 Jun 18
3
R_using non linear regression with constraints
...ass, aes( x=a, y=b, z = x, fill=x ) ) + geom_tile() + geom_contour( breaks= brks ) + geom_point( x=a, y=b, colour="red" ) + geom_point( x=objdtassmin$a , y=objdtassmin$b , colour="green" ) + scale_fill_continuous( name="SumSq", breaks = brks ) # Green point is brute-force solution # Red point is optimizer solution for myfun ############## myfun2 <- function( a, log1ab, r, t ) { ab <- 1000 - exp( log1ab ) ab * ( 1 - exp( -ab/a * r * t ) ) } objdta$log1ab <- with( objdta, log( 1000 - a * b ) ) objdt...
2017 Jun 18
0
R_using non linear regression with constraints
...) + > geom_tile() + > geom_contour( breaks= brks ) + > geom_point( x=a, y=b, colour="red" ) + > geom_point( x=objdtassmin$a > , y=objdtassmin$b > , colour="green" ) + > scale_fill_continuous( name="SumSq", breaks = brks ) > # Green point is brute-force solution > # Red point is optimizer solution for myfun > > ############## > > myfun2 <- function( a, log1ab, r, t ) { > ab <- 1000 - exp( log1ab ) > ab * ( 1 - exp( -ab/a * r * t ) ) > } > > objdta...
2002 Jul 11
0
another aov question: unbalanced multiple responses
...d, when I do > aov( y~Modality*size + Error(Snr/(Modality*size)) ) I indeed get a result without any warning. Remembering a remark on unbalanced designs in aov, I ran the same (?..) test in NCSS. It too gives results without any warnings or errors, but they're not exactly the same. The DF, SumSQ, MeanSq and F values are the same for Snr:size and for Snr:size:Modality, but they are not (except DF) for Snr:Modality and Snr. (On fully balanced data, I did get the same values in both progs.) I have not found anything purporting to this specific situation in the documentation of either program...
2001 Oct 17
3
Type III sums of squares.
Peter Dalgaard writes (in response to a question about 2-way ANOVA with imbalance): > ... There are various > boneheaded ways in which people try to use to assign some kind of > SumSq to main effects in the presence of interaction, and they are all > wrong - although maybe not very wrong if the unbalance is slight. People keep saying this --- very vehemently --- and it is NOT TRUE. Point 1 --- imbalance is really irrelevant here, a fact which is usually (always?) overlooked...
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.
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
2001 Oct 16
4
two way ANOVA with unequal sample sizes
Hi, I am trying a two way anova with unequal sample sizes but results are not as expected: I take the example from Applied Linear Statistical Models (Neter et al. pp889-897, 1996) growth rate gender bone development 1.4 1 1 2.4 1 1 2.2 1 1 2.4 1 2 2.1 2 1 1.7 2 1 2.5 2 2 1.8 2 2 2 2 2 0.7 3 1 1.1 3 1 0.5 3 2 0.9 3 2 1.3 3 2 expected results are
2004 Apr 23
0
Sum Sq of SPSS and R different for repeated measures Anova
...esults but for the main effects of pictcat and cond and their interaction. The Sum of squares of R are slightly larger (in itself not a bad thing because it results in larger F-ratio's) than those of SPSS (resp., 62141, 5747, 416 for pictcat, cond, pictcat:cond). The funny thing is that the SumSq are spot on for the interactions with the between-SS factor exp. The data for both analyses are exactly the same. I've read about R using type I SS, but if I change the type III default of SPSS into type I, the results get more different, instead more more comparable. I've read about d...