search for: squared

Displaying 20 results from an estimated 5633 matches for "squared".

Did you mean: square
2011 Jun 28
2
How do I output all the R-squares of an SUR? summary(fitSUR$eq[[1:4]])$r.squared does not work
Greetings R Users, I have a system of equations for which I would like to output all the R-squares. Assume there are four equations in my system, the only way I found to output all the R-squares is by calling them out one by one as this: summary(fitSUR$eq[[1]])$r.squared summary(fitSUR$eq[[2]])$r.squared summary(fitSUR$eq[[3]])$r.squared summary(fitSUR$eq[[4]])$r.squared But isn't there a way of making this automatic, for example, something more along the way of summary(fitSUR$eq[[1:4]])$r.squared ? The above does not work, by the way. I have attached belo...
2009 Feb 04
1
igraph: error when setting size and shape of vertices
When the shape of all vertices is set to "square" and the size of the vertices is also set, one get following error (commands attached): Error in l[[which.min(sapply(l, function(p) (p[1] - x0)^2 + (p[2] - y0)^2))]] : attempt to select less than one element Is there a way to solve this problem? Robbie ## Load the igraph package library(igraph) ## Create and plot a small graph
2012 Aug 30
2
self-defined distance function to be computed on matrix
Hello, I have a self-defined function to be computed on each column in a matrix. The basic idea is to ignore the elements that have value of 0 during computation. I should be able to write my own function but it could be computational expensive, so I'd love to ask if anyone may have suggestions on how to implement it more efficiently. Thanks in advance. For example, there are three
2012 Dec 03
4
Chi-squared test when observed near expected
Dear UseRs, I'm running a chi-squared test where the expected matrix is the same as the observed, after rounding. R reports a X-squared of zero with a p value of one. I can justify this because any other result will deviate at least as much from the expected because what we observe is the expected, after rounding. But the formula fo...
2004 Mar 19
5
asp=1 and aspect ratio
Hi everyone I want a square scatterplot with abline(0,1) going exactly through the SW and NE corners. By "square" I mean that the plotting region is exactly square, and that the axis limits are identical. x <- 1:20 y <- x+rep(c(-1,1),10) lims <- range(c(x,y)) None of the following do this: plot(x,y) ; abline(0,1) #not square plot(x,y,asp=1);abline(0,1) #diagonal
2011 Sep 08
2
Extract r.squared using cbind in lm
Hello, I am using cbind in a lm-model. For standard lm-models the r.squared can be easily extracted with summary(model)$r.squared, but that is not working in in the case with cbind. Here an example to illustrate the problem: a <- c(1,3,5,2,5,3,1,6,7,2,3,2,6) b <- c(12,15,18,10,18,22,9,7,9,23,12,17,13) c <- c(22,26,32,33,32,28,29,37,34,29,30,32,29) data <-...
2006 Aug 25
1
R.squared in Weighted Least Square using the Lm Function
Hello all, I am using the function lm to do my weighted least square regression. model<-lm(Y~X1+X2, weight=w) What I am confused is the r.squared. It does not seem that the r.squared for the weighted case is an ordinary 1-RSS/TSS. What is that precisely? Is the r.squared measure comparable to that obtained by the ordinary least square? <I also notice that model$res is the unweighted residual while summary(model)$res is the weighted resi...
2007 May 17
4
R2 always increases as variables are added?
Hi, everybody, 3 questions about R-square: ---------(1)----------- Does R2 always increase as variables are added? ---------(2)----------- Does R2 always greater than 1? ---------(3)----------- How is R2 in summary(lm(y~x-1))$r.squared calculated? It is different from (r.square=sum((y.hat-mean (y))^2)/sum((y-mean(y))^2)) I will illustrate these problems by the following codes: ---------(1)----------- R2 doesn't always increase as variables are added > x=matrix(rnorm(20),ncol=2) > y=rnorm(10) > > lm=lm(y~1) &gt...
2004 Jun 06
3
Average R-squared of model1 to model n
...interpretating R-suqared. The actual outputs for a test dataset is X=(x1,x2, ..., xn). model 1 predicted the outputs as Y1=(y11,y12,..., y1n) model n predicted the outputs as Y2=(y21,y22,..., y2n) ... model m predicted the outputs as Ym=(ym1,ym2,..., ymn) Now we have two ways to calculate R squared to evaluate the average performance of committee model. (a) Calculate R squared between (X, Y1), (X, Y2), ..., (X,Ym), and then averaging the R squared (b) Calculate average Y=(Y1+Y2, + ... Ym)/m, and then calculate the R squared between (X, Y). We found it seemed that R squared calculated in...
2010 Jan 22
4
Extract R-squared from summary of lm
Dear all, I cannot find to explicitly get the R-squared or adjusted R-squared from summary(lm()) Thanks a lot! [[alternative HTML version deleted]]
2011 Jul 21
4
squared "pie chart" - is there such a thing?
Hello! It's a shoot in the dark, but I'll try. If one has a total of 100 (e.g., %), and three components of the total, e.g., mytotal=data.frame(x=50,y=30,z=20), - one could build a pie chart with 3 sectors representing x, y, and z according to their proportions in the total. I am wondering if it's possible to build something very similar, but not on a circle but in a square - such that
2013 Feb 16
2
Interpret R-squared and cor in R
Hi I am trying to find the relationship between two variables. First I fitted a linear model between two variables and I found the following results: Residual standard error: 0.03253 on 2498 degrees of freedom Multiple R-squared: 0.5551, Adjusted R-squared: 0.5549 F-statistic: 3116 on 1 and 2498 DF, p-value: < 2.2e-16 Then I used the cor function to see the correlation between two variable I get the following result -0.7450344 How can we interpret the result based on R-squared and correlation ? From the p-value we c...
2010 Dec 29
1
Problem applying Chi-square in R and Cochran's Recommendations
...e while applying chisquare test to the following Data ( below the subject of this mail) ...when I wanted to test the significance using three different free statistical packages, here R, EpiInfo and OpenEpi. *Only OpenEpi accepts the test based on Cochran's Recommendations. * R says " chi squared approximation may be incorrect." Does it mean the same as what EpInfo saying " Chi square is not valid" Regards, Dr. B. Manoj Aravind. *Table for analysis* Number of STDs Identified Type of Health worker <2 2 or > ASH...
2011 Oct 11
3
Chi-Square test and survey results
...9 Region_14 774 121 Region_15 561 24 Region_16 834 134 How well does the survey represent the employee population? Chi-square test says, not very well: > chisq.test(ByRegion) Pearson's Chi-squared test data: ByRegion X-squared = 163.6869, df = 15, p-value < 2.2e-16 By striking three under-represented regions (3,6, and 15), we get a more reasonable, although still not convincing, result: > chisq.test(ByRegion[setdiff(1:16,c(3,6,15)),]) Pearson's Chi-squared test data:...
2008 Nov 10
3
in R when I get negative adjusted R^2 using "lm", what might be the problem?
This is a linear regression of Y onto factors... If I take log of Y, and regress onto the factors, I got: Multiple R-squared: 0.4023, Adjusted R-squared: 0.2731 If I don't take log of Y, and directly regress Y onto the factors, I got: Multiple R-squared: 0.1807, Adjusted R-squared: -0.001112 Is this negative adjusted R^2 a problem? What observation can I make here and what might be the problem? Thanks!
2013 Jul 29
1
[LLVMdev] llvm-g++ 4.6.4 unable to compile simple shared library on Ubuntu 12.04 x86_64
...3.0-3 C front end for LLVM C/C++ compiler ii llvm-runtime 2.9-7 Low-Level Virtual Machine (LLVM), bytecode interpreter I have a very simple example that appears to illustrate this problem /******** squared.h BEGIN *****/ int squared(int val); /********* END *****/ /******* squared.c BEGIN ****/ int squared(int val) { return val*val; } /********* END ****/ /**** main.c BEGIN *****/ #include <stdio.h> int main(int argc,char *argv[] ) { int i = 0; for( i = 0; i &...
2003 Apr 22
4
fisher exact vs. simulated chi-square
...C"),c("A1","A2","A3"))) > ta A1 A2 A3 A 45 32 1 B 85 40 2 C 27 34 1 > fisher.test(ta) Fisher's Exact Test for Count Data data: ta p-value = 0.02337 alternative hypothesis: two.sided > chisq.test(ta, simulate=T, B=100000) Pearson's Chi-squared test with simulated p-value (based on 1e+05 replicates) data: ta X-squared = 9.6976, df = NA, p-value = 0.04037 > chisq.test(ta) Pearson's Chi-squared test data: ta X-squared = 9.6976, df = 4, p-value = 0.04584 Warning message: Chi-squared approximation may be incorrect in: chisq.te...
2004 Jul 22
1
Bug: wrong R-squared in lm formula w/o intercept (PR#7127)
Full_Name: Adriano Azevedo Filho Version: 1.9.1 OS: Windows, Linux Submission from: (NULL) (200.171.246.212) R-squared and Adjusted R-squared appear to be wrong when the formula in lm() is specified without intercept. Problem present in both Windows and Linux 1.9.1 version. Also in the 1.8.1 version for Windows (other versions not checked). Possible example which reproduces the problem: x<-1:10 y<-c(2,4,3,4...
2006 Jan 24
6
R vs. Excel (R-squared)
Hello All- I found an inconsistency between the R-squared reported in Excel vs. that in R, and I am wondering which (if any) may be correct and if this is a known issue. While it certainly wouldn't surprise me if Excel is just flat out wrong, I just want to make sure since the R- squared reported in R seems surprisingly high. Please let me kn...
2003 Nov 03
2
Odd r-squared
Hi, I would consider the calculation of r-squared in the following to be a bug, but then, I've been wrong before. It seems that R looks to see if the model contains an intercept term, and if it does not, computes r-squared in a way I don't understand. To my mind, the following are two alternative parametrizations of the same model, and s...