similar to: a little statistics help

Displaying 20 results from an estimated 20000 matches similar to: "a little statistics help"

2002 Jun 26
3
Help with concatenation and arrays
Dear R-guRus: I have 2 questions 1) I have 2 variables, e.g. x<-5; y<-"Char" How do I create a new variable which would have both these values in a string (e.g. "5Char", or "5 Char", etc ) ?? 2) if i have an array x[1:100], and I do x[x==345.123], how do I get position j in the array of those x[j] which are equal to 345.123 ? Thank you very much, Vlad.
2004 Mar 08
2
getting the std errors in the lm function
Hello, I have a simple question for you: making: mylm<-lm(y~x) summary(mylm) I get the following results: ****************************************************** Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 16.54087 0.19952 82.91 <2e-16 *** x[1:19] -2.32337 0.04251 -54.66 <2e-16 *** ******************************************************
2002 Aug 03
2
variable scope
Dear R-guRus: I would like to pass variables to a function in R in "by reference", e.g Fortran style. For example, suppose I have the following code x<-c(1:10) y<-1 MyFunc<-function(x,y) {y<-sum(x); return(NULL)} MyFunc(x,y) print(y) in this case print(y) will produce "1" instead of 55 (which is sum(x)) - how do I make sure that afte the function is run, y
2002 Aug 03
2
variable scope
Dear R-guRus: I would like to pass variables to a function in R in "by reference", e.g Fortran style. For example, suppose I have the following code x<-c(1:10) y<-1 MyFunc<-function(x,y) {y<-sum(x); return(NULL)} MyFunc(x,y) print(y) in this case print(y) will produce "1" instead of 55 (which is sum(x)) - how do I make sure that afte the function is run, y
2009 May 14
1
automated polynomial regression
Dear all - We perform some measurements with a machine that needs to be recalibrated. The best calibration we get with polynomial regression. The data might look like follows: > true_y <- c(1:50)*.8 > # the real values > m_y <- c((1:21)*1.1, 21.1, 22.2, 23.3 ,c(25:50)*.9)/0.3-5.2 > # the measured data > x <- c(1:50) > # and the x-axes > > # Now I do the following:
2002 Jul 17
9
problem formatting data frames
Dear R-guRus: I have a problem with the format of my data in R. Let's say I have a HUGE text table which consists of columns of numerical data, separated by tabs, but in some places rows of text (error messages, etc) are inserted in between rows of numerical data. Because the data file is so huge and because I have thousands of these files, it's unpractical to try and go thru these
2009 Mar 31
1
using "substitute" inside a legend
Hello list, I have a linear regression: mylm = lm(y~x-1) I've been reading old mail postings as well as the plotmath demo and I came up with a way to print an equation resulting from a linear regression: model = substitute(list("y"==slope%*%"x", R^2==rsq), list(slope=round(mylm$coefficients[[1]],2),rsq=round(summary(mylm)$adj.r.squared, 2))) I have four models and I
2002 Oct 21
2
overlaying plots
Dear R-gurus: How do I overlay 2 plots in the same frame in R? Or, if I have a histogram, and I want to plot a function in the same frame - how do I do it? Thank you very much, Vlad -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or
2007 Apr 06
2
lm() intercept at the end, rather than at the beginning
Hi, I wonder if someone has already figured out a way of making summary(mylm) # where mylm is an object of the class lm() to print the "(Intercept)" at the last line, rather than the first line of the output. I don't know about, say, biostatistics, but in economics the intercept is usually the least interesting of the parameters of a regression model. That's why, say, Stata
2023 Mar 22
1
How to test the difference between paired correlations?
Hello, I have three numerical variables and I would like to test if their correlation is significantly different. I have seen that there is a package that "Test the difference between two (paired or unpaired) correlations". [https://www.personality-project.org/r/html/paired.r.html] However, there is the need to convert the correlations to "z scores using the Fisher r-z
2007 Oct 30
1
Some matrix and sandwich questions
Dear R-help, I have a four-part question about regression, matrices, and sandwich package. 1) In the sandwich package, I would like to better understand the meat() function. >From the bread() documentation, for a simple OLS regression, bread() returns (1/n * X'X)^(-1) That is, for a simple regression (per the documentation on bread()): MyLM <- lm(y ~ x) bread(MyLM)
2023 Mar 23
1
How to test the difference between paired correlations?
Thank you, but this now sounds more difficult: what would be the point in having these ready-made functions if I have to do it manually? Anyway, How would I implement the last part? On Thu, Mar 23, 2023 at 1:23?AM Ebert,Timothy Aaron <tebert at ufl.edu> wrote: > > If you are open to other options: > The null hypothesis is that there is no difference. > If I have two equations
2009 Jan 24
2
how to prevent duplications of data within a loop
Hi All, I had posted a question on a similar topic, but I think it was not focused. I am posting a modification that I think better accomplishes this. I hope this is ok, and I apologize if it is not. :) I am looping through variables and running several regressions. I have reason to believe that the data is being duplicated because I have been monitoring the memory use on unix. How can I avoid
2010 Sep 14
1
NA confusion (length question)
Hi folks, I am running a very simple regression using mylm <- lm(mass ~ tarsus, na.action=na.exclude) I would like the use the residuals from this analysis for more regression but I'm running into a snag when I try cbind(mylm$residuals, mydata) # where my data is the original data set The error tells me that it cannot use cbind because the length of mylm$residuals is
2003 Oct 11
1
Subclassing lm
I'd trying to subclass the "lm" class to produce a "mylm" class whose instances behave like lm objects (are accepted by methods like summary.lm) but have additional data or slots of my own design. For starters: setClass("mylm", "lm") produces the somewhat cryptic: Warning message: Old-style (``S3'') class "mylm" supplied as a
2006 Jan 16
4
Standardized beta-coefficients in regression
Hello list, I am used to give a lot of attention to the standardized regression coefficients, which in SPSS are listed automatically. Is there alternative to running the last two lines in the following example to get all the information? ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) summary( lm(ctl ~ trt) )
2011 May 20
2
extraction of mean square value from ANOVA
Hello, I am randomly generating values and then using an ANOVA table to find the mean square value. I would like to form a loop that extracts the mean square value from ANOVA in each iteration. Below is an example of what I am doing. a<-rnorm(10) b<-factor(c(1,1,2,2,3,3,4,4,5,5)) c<-factor(c(1,2,1,2,1,2,1,2,1,2)) mylm<-lm(a~b+c) anova(mylm) Since I would like to use a loop to
2005 Feb 17
1
short plots: lwd, margin and postscript behavior
Hi all. I'm working with a short plot (3x3 inches), but the results (via postscript command) are not nice. The lwd command don't affect the lines (that are very large) and the margins don't change using oma, mai, mar, ... Below I put an example. Moreover, save the graphics via postscript command isn't working well (see the attached ps). Thanks by the help, Cezar Freitas.
2011 Nov 22
4
evaluation question
Dear R People: Hope you're having a nice day. Here is a character vector: > yz [1] "pexp(3.2,rate=1)" > str(yz) chr "pexp(3.2,rate=1)" > And I would like to evaluate that vector. I tried: > eval(as.expression(yz)) [1] "pexp(3.2,rate=1)" > But that doesn't work. Any suggestions would be most welcome. I have a feeling that it's quite
2005 Jun 16
1
regressing each column of a matrix on all other columns
DeaR list I would like to predict the values of each column of a matrix A by regressing it on all other columns of the same matrix A. I do this with a for loop: A <- B <- matrix(round(runif(10*3,1,10),0),10) A for (i in 1:length(A[1,])) B[,i] <- as.matrix(predict(lm( A[,i] ~ A[,-i] ))) B It works fine, but I need it to be faster. I've looked at *apply but just can't