[R] linear regression and testing the slope
Dear All, First of all I would like to say I do not have much knowledge about this subject, so most of you can find it really easy. I am doing a linear regression and I want to test if the slope of the curve is 0. R gives the summary statistics: Call: lm(formula = x ~ s) Residuals: Min1QMedian3Q Max -0.025096 -0.020316 -0.001203 0.011658 0.044970 Coefficients: Estimate Std. Error t value Pr(|t|) (Intercept) 0.005567 0.016950 0.3280.750 s -0.001599 0.002499 -0.6400.538 Residual standard error: 0.02621 on 9 degrees of freedom Multiple R-squared: 0.04352,Adjusted R-squared: -0.06276 F-statistic: 0.4095 on 1 and 9 DF, p-value: 0.5382 what is this t-value for? The explanation in the help file was unfortunately not clear to me. How can I test my hypotheses that if the slope is 0? Thank you in advance, regards, Evrim [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] histogram plots with many different samples
Dear R users, I would like to draw some histograms as seen in the page whose address I wrote below. I searched through the web a lot and I found a page which describes how I can do it for older versions of R. For newer versions they recommend to install the package R.basics in R.clusters but this does not exist. The address of the web page is http://www1.maths.lth.se/help/R/plot.histogram/ Unfortunately I could not find any other resource or help. Is it possible to make histograms like I wanted with R? If so, could you please give any advise on how I can do it? Thank you, Regards, evrim [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] modification of the function ecdf
Dear R users, I am trying to minimize the distance between my data points and theoretical gamma distribution over shape and scale parameters. the function mde from actuar package does it for empirical distribution function and theoretical gamma distribution. However, I would like to minimize the distance by using only the data between 0.1 and 0.9 quantiles. I cannot use ecdf in this case as my sample is not a whole sample. Therefore I would like to modify the function ecdf as it gives the ecdf between 0.1 and 0.9 quantiles. I wrote ecdf1- function (x) { x - sort(x) k-kuantile(x,c(0.1,0.9)) z-x[x=k[2]] z-z[z=k[1]] n - length(x) if (n 1) stop('x' must have 1 or more non-missing values) vals - unique(z) rval - approxfun(vals, cumsum(tabulate(match(x, vals)))/n, method = constant, yleft = 0.1, yright = 0.9, f = 0, ties = ordered) class(rval) - c(ecdf, stepfun, class(rval)) attr(rval, call) - sys.call() rval }** (I also tried it with yleft = 0, yright = 1, it gave the same error) But appearently it is wrong and it gives the error Error in vector(integer, length) : vector size cannot be NA (I also tried it with yleft = 0, yright = 1, it gave the same error) I am not good at programming and I could not understand the mistake. I checked also the approxfun and I suspect I damage something there by using z in ecdf1, however I am not sure. I would like to find that function and use it in mde instead of ecdf for methodCvM. you can see the part I would like to modify in mde function. if (measure == CvM) { G - fn Gn - if (grouped) ogive(x) else ecdf(x) if (is.null(weights)) weights - 1 Call$x - knots(Gn) Call$par - start } .. I'd appreciate if you could suggest a way to create the empirical distribution function after the 0.1-quantile till 0.9-quantile. So as opposed to ecdf the y-axis will be from 0.1 to 0.9 rather than 0 to 1. Or, a way to find the minimum distance between the theoretical gamma distribution and empirical distribution between 0.1 and 0.9 th percentiles. Thank you in advance, Regards, Evrim [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] incomplete data analysis
Dear R users, First of all, thank you for your help about goodness of fit tests. I have another set of data and i am sure it is incomplete. I searched for incomplete data analysis with R but I could not find any suggestion, or method. Lets say (totally hypothetical situation) from a distribution you can generate a continuous random sample between the numbers 0 and 100. but I have data from 20 to 80 and the rest is missing. I suspect this data comes from the distribution I mentioned. If I use tests like ks.test or chi-square to test if the data comes from this distribution it says NO because it takes my sample as whole sample. If there is any suggestion about the package I have to read, or function I have to use or I can modify, I would be very glad. Thank you in advance. PS:I would like to prevent any misunderstanding, I am not asking for a code. Maybe, I could not find the right words to search and I would appreciate any help (name of the package or search key words or even if it is possible or not...) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] chi squared goodness of fit test with R
Dear R users, I am a master student in Mathematics and I am writing my thesis in statistics. I need to use R and unfortunately I do not have any experience with a computer program. Could you please help me about chi squared goodness of fit test with R? In R-help website I saw a message about how to do that but I do not know how to cut the data into bins and calculate the expected numbers in each bin. Moreover I have to count the observed data in each bin and I do not know how to do that either. I really need help as its an essential part of my study. I appreciate if you could help. Thank you in advance, regards, Evrim Akar [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] chi squared goodness of fit test with R
Dear R users, I am a master student in Mathematics and I am writing my thesis in statistics. I need to use R and unfortunately I do not have any experience with a computer program. Could you please help me about chi squared goodness of fit test with R? In R-help website I saw a message about how to do that but I do not know how to cut the data into bins and calculate the expected numbers in each bin. Moreover I have to count the observed data in each bin and I do not know how to do that either. I really need help as its an essential part of my study. I appreciate if you could help. Thank you in advance, regards, [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.