similar to: Data Analysis Functions in R

Displaying 20 results from an estimated 200 matches similar to: "Data Analysis Functions in R"

2006 Jul 14
3
Generating random normal distribution with mean 0 and standard deviation 1
Hello, This must be really simple, but I can't find it on R Site search. I need to generate a random normally distributed series with mean 0 and sd 1. In Matlab, this code is randn(n). The closest I found is runif(20,-1,1) but this forces a maximum and a minimum, and there's no way to specify a standard deviation of 1. >sd(runif(20,-1,1)) [1] 0.578164
2016 Apr 27
3
Create a new variable and concatenation inside a "for" loop
Hello, Suppose the you need a loop to create a new variable , i.e., you are not reading data from outside the loop. This is a simple example in Matlab code, for i=1:5 r1=randn r2=randn r=[r1 r2] c(i,:)=r; % creation of each row of c , % the ":" symbol indicates all columns. In R this would be [i,] end The output of interest is c which I'm creating inside the "for" loop
2016 Apr 27
0
Create a new variable and concatenation inside a "for" loop
"c" an extremely commonly-used function. Functions are first-class objects that occupy the same namespaces that variables do, so they can obscure each other. In short, don't use variables called "c" (R is case sensitive, so "C" has no such problem). Wherever possible, avoid incremental concatenation like the plague. If you feel you must use it, at least
2016 Apr 27
3
Create a new variable and concatenation inside a "for" loop
... "(R is case sensitive, so "C" has no such problem)." Well, not quite. Try ?C To add to the previous comments, Dr. Gordon appears to need to do her/his homework and spend some time with an R tutorial or two before posting further here. There are many good ones on the web. Some recommendations can be found here: https://www.rstudio.com/online-learning/#R Cheers, Bert
2016 Apr 28
0
Create a new variable and concatenation inside a "for" loop
Maybe I wasn't clear about my query. I'm very familiar with pre-allocation and vectorization and I had already wrote an R code for this problem in this way. My question wasn't about the most efficient way to solve the problem. It was about whether in R it was possible to use the same index used in the loop to create a new variable and store the results in as in the example showed
2007 Jul 07
1
Minor bug in lillie.test from nortest package (PR#9784)
Full_Name: David Sterling Version: 2.4.0 OS: OS X Submission from: (NULL) (64.81.102.199) lillie.test() dies without grace producing the error message: 'Error in if (pvalue > 0.1) { : missing value where TRUE/FALSE needed' when passed a vector of identical values. Examples: > lillie.test(c(0,0,0,0,0,0,0,0,0,0)) Error in if (pvalue > 0.1) { : missing value where TRUE/FALSE
2004 Feb 04
5
nortest package
Hi, I'm a newbie and i am unable to use lillie.test in nortest I have a message: "Couldn't find function "lillie.test" I am under windows2000 with R1.8.1 nortest is listed with .packages(TRUE) How to do to use lillie.test function? Laurent Houdusse Analyste Programmeur
2010 Feb 22
4
Normal distribution (Lillie.test())
Hi all, I have a dataset of 2000 numbers ( it's noise measured with a scoop ) Now i want to know of my data is normal distributed (Gaussian distribution). I did already: - 68-95-99.7 test - Q-Q-plot and now i used "nortest library" and the Lilli.test() However i don't understad the output? lillie.test(z) Lilliefors (Kolmogorov-Smirnov) normality test data: z D =
2007 May 07
1
Simple question about function with glm
Dear all, I coded a function called u.glm u.glm <- function (x,ahi,age,bmiz,gender) { library(nortest) lil.rslt <- lillie.test(x) if (lil.rslt$p.value >0.05) { cat("Logtrans=0, lillie=",lil.rslt$p.value,"\n") xmodel<-glm(x~ahi+age+bmiz+as.factor(gender)) summary(xmodel) confint(xmodel) } else { cat("Logtrans=1,
2007 Nov 21
1
equivalent of Matlab robustfit?
Hi, I've been using the Matlab robustfit function for linear regressions where I suspect some data points are outliers. Is there an equivalent function in R? Take care, Darren PS, This is the Matlab help on robustfit: >> help robustfit ROBUSTFIT Robust linear regression B = ROBUSTFIT(X,Y) returns the vector B of regression coefficients, obtained by performing robust
2012 Mar 28
2
Test Normality
Good Night I made different test to check normality and multinormality in my dataset, but I donĀ“t know which test is better. To verify univariate normality I checked: shapiro.test, cvm.test, ad.test, lillie.test, sf.test or jaque.bera.test and To verify multivariate normal distribution I use mardia, mvShapiro.Test, mvsf, mshapiro.test, mvnorm.e. I have a dataset with almost 1000 data and 9
2008 Feb 13
0
FinTS_0.2-7
Hi, All: FinTS version 0.2-7 is now available on CRAN. This version adds two new functions: * ArchTest to compute the Engle (1982) Lagrange multiplier test for conditional heteroscedasticity, discussed on pp. 101-102 of Tsay, with examples on those pages worked in the R script in "~R\library\FinTS\scripts\ch03.R", where "~R" is your local R installation directory.
2008 Feb 13
0
FinTS_0.2-7
Hi, All: FinTS version 0.2-7 is now available on CRAN. This version adds two new functions: * ArchTest to compute the Engle (1982) Lagrange multiplier test for conditional heteroscedasticity, discussed on pp. 101-102 of Tsay, with examples on those pages worked in the R script in "~R\library\FinTS\scripts\ch03.R", where "~R" is your local R installation directory.
2004 Feb 06
2
Normality Test on several groups
Hi, I use ks.test or lillie.test to verify a normal distribution. It's performed for a group My users use SigmaStat software and a One Way ANOVA on several groups In the result page there is a probability value to determine if Normality test is failed or passed So, how can i retrieve this probability value on several groups? Is there another function in R to verify normality on several
2003 Feb 06
6
Confused by SVD and Eigenvector Decomposition in PCA
Hey, All In principal component analysis (PCA), we want to know how many percentage the first principal component explain the total variances among the data. Assume the data matrix X is zero-meaned, and I used the following procedures: C = covriance(X) %% calculate the covariance matrix; [EVector,EValues]=eig(C) %% L = diag(EValues) %%L is a column vector with eigenvalues as the elements percent
2001 Nov 12
2
Announcement: Automatic ATLAS support under Debian GNU/Linux
[ If this is considered off-topic please let me know in private mail. ] With the current version of the glibc library in Debian's "testing" and "unstable" distributions, ldconfig now loads the ATLAS optimised BLAS without any user intervention beyond installation of the Atlas and R or Octave packages. ATLAS can lead to very dramatic speed increases (up to a factor of ten,
2008 Dec 23
1
Approximate Entropy?
Dear guRus, is there a package that calculates the Approximate Entropy (ApEn) of a time series? RSiteSearch only gave me a similar question in 2004, which appears not to have been answered: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/28830.html RSeek.org didn't yield any results at all. Happy holidays (where appropriate), Stephan
2011 Aug 15
2
Extracting information from lm results (multiple model runs)
Just to inform: I posted that before in R-sig-ecology but as it might be interesting also for other useRs, I post it also to the general r-user list: Hello Alexandre, thank you very much. I also found another way to extract summarizing information from lm results over e.g. 1000 repeated model runs: results2 <- t(as.data.frame(results)) summary(results2) Although some questions popped up in
2006 Jun 13
1
Cramer-von Mises normality test
Hi, this is my first help request so please bear with me. I've been running some normality tests using the nortest package. For some of my datasets the Cramer-von Mises normality test generates an extremely high probability (e.g., 1.637e+31) and indicates normality when the other tests do not. Is there something I'm misunderstanding or potentially a bug in the code? Below are the
2006 Jun 14
1
Bug in nortest cvm.test package (PR#8980)
I believe there to be a bug in the cvm.test module of the nortest package authored by Juergen Gross. I do not know how to contact the author directly. I've been running some normality tests using the nortest package. For some of my datasets the Cramer-von Mises normality test generates an extremely high probability (e.g., 1.637e+31) and indicates normality when the other tests do