Stefan---
Under the measure-theoretic approach to probability, discrete & continuous
probability densities follow the same underlying mathematical principles.
Check any text on measure-theoretic probability theory.
---JFL
Stefan Schreiber
Sent by: "R-help"
03/14/2019 08:43 PM
To
The script is complete. When I start, the environment is empty.
The warnings are issued for these "ghost" variables well before they are
created later in the script.
Somehow previous incarnations are lingering around and being unhappy even
after they were "deleted".
Jeff Newmiller has
Fellow R-gonauts:
I frequently erase/remove all the objects in my current environment so can
I re-run scripts to ensure that analyses are complete, error-free, and
accurate.
However, sometimes when I re-rerun a script I get warning messages (see
below for example) regarding some variables
R Users:
Whenever I fire up R, I now get the following message (red) at the end of
the prologue.
R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY
The more general model for estimating structural models is lavaan,
contained in the package lavaan.
yaya bamba via R-help
Sent by: "R-help"
05/10/2018 12:01 PM
Please respond to
yaya bamba
To
"r-help@r-project.org"
I wish to second this approach to learning R.
I tried for several years to translate other stat programs or provide
parallel analyses with R.
This dabbling-in-R approach did not work
.
When a transferred to a research unit that could ill afford commercial
software, I devoted my entire time
N <- 100
C <- 50
x <- numeric(N)
for (i in 1:N){
x[i] <- sample(C-sum(x),1)
}
x
sum(x)
Frederic Ntirenganya
Sent by: "R-help"
07/19/2016 01:41 PM
To
"r-help@r-project.org" ,
cc
Subject
[R] Sampe numbers
Hi
There is a video tutorial on the RStudio web site showing how to create R
packages within RStudio. Hadley Wickham also has a book on creating R
packages.
Bert Gunter
Sent by: "R-help"
06/03/2016 02:27 PM
To
suparna biswas
R users:
Suppose I have a function that takes three numeric arguments x, y, and z,
any of which may be scalars or vectors.
Suppose further that the user takes one of the arguments, say y, as a
vector with the other two as scalars.
Is there an existing R function that will promote the other
You should consider the package "caper", which provides a CAIC.
From the caper manual
"The caper package implements the methods originally provided in the
programs CAIC (Purvis
and Rambaut, 1995b) and MacroCAIC (Agapow and Isaac, 2002)."
Hope this helps.
Gabriela Wofkova
Erin
There is a LaTeX package called listings. It has an R option to
prettyprint code. Never used it.
Joe
"Kevin E. Thorpe"
Sent by: "R-help"
12/10/2015 12:14 PM
To
Erin Hodgess ,
cc
R help
Scratch the rchisq (it should have been sqrt(rchisq), but that doesn't
help.).
Use the truncated normal
u <- 3; a <- 2;
N <- 100
x <- numeric(N)
for (i in 1:N){
repeat{
if( (x[i] <- rnorm(1, u, a)) >= 0 ) break
}
}
or the folded normal
abs(rnorm(N, u, a)),
They give similar
Your question makes no sense as stated. However, guessing at what you
want, you should perhaps consider the non-central chi-square density with
1 df and ncp = u/a, i.e,
rchisq(100, df=1, ncp=u/a)
Joe
Joseph F. Lucke, PhD
Senior Statistician
Research Institute on Addictions
University at
As a start you can use an exploratory approach. Standard survival
analysis texts show you how to use a log-log plot to assess whether a
distribution is Weibull. Of course, the exponential is a special case of
the Weibull.
CHIRIBOGA Xavier xavier.chirib...@unine.ch
Sent by: R-help
Your function phi has 5 arguments with no defaults. Your call only has 3
arguments. Hence the error message.
phi - function(w1, w2, j, k, K){
+ zaehler - (k/K)^(w1-1)*(1-k/K)^(w2-1)
+ nenner - sum( ((1:K)/K)^(w1-1)*(1-(1:K)/K)^(w2-1))
+ return( zaehler/nenner )
+ }
phi(c(1, 1), 44L,
ylim(0%,100%) is not valild. It should be ylim(0,100).
Jeff Newmiller jdnew...@dcn.davis.ca.us
Sent by: R-help r-help-boun...@r-project.org
03/25/2015 11:14 AM
To
BenedettaB24 . benedetta.brune...@gmail.com, r-help@r-project.org
r-help@r-project.org,
cc
Subject
Re: [R] Graph with ggplot2.
The distribution of the statistic $ndf * r^2 / (1-r^2)$ with the true
value $\rho = zero$ follows an $F(1,ndf)$ distribution.
So the t-test is the correct test for $\rho=0$.
Fisher's z is an asymptotically normal transformation for any value of
$\rho$.
Thus Fisher's z is better for testing
...@ria.buffalo.edu,
cc
Duncan Murdoch murdoch.dun...@gmail.com, r-help@r-project.org
r-help@r-project.org, r-help-boun...@r-project.org
Subject
Re: [R] Inverse Student t-value
Hi JLucke,
Maybe the old excel function. TINV and T.INV.2T is same function for T
wo-Tailed Inverse of the student`s t
My Excel (2013) returns exactly what R does. I used both T.INV and
T.INV.T2There is no TINV. Has Excel been updated?
Duncan Murdoch murdoch.dun...@gmail.com
Sent by: r-help-boun...@r-project.org
09/30/2014 02:36 PM
To
Andre geomodel...@gmail.com,
cc
r-help@r-project.org
Subject
Re:
The website has your answer. The t-distribution is a regularized
incomplete beta function. The incomplete beta function is given by R's
pbeta function. You regularize it with R's beta function. Then you use
R's uniroot function to find the inverse. Good homework problem.
Andre
#First, correct your code
H - 0.7;
t - 1;
s - seq(0,t,0.1);
x - 1-t/s;
library(gsl)
Gauss2F1 - function(H,x){
a - H-1/2;
b - 1/2-H;
c - H+1/2;
# if(x=0 x1){
#hyperg_2F1(a,b,c,x)
# }else{
hyperg_2F1(c-a,b,c,1-1/(1-x))/(1-x)^b
# }
}
#Here
#F - Gauss2F1(a,b,c,x)
#and here
I made a stupid mistake. My note at the end is irrelevant as is the code
before the library statement.
Instead, the upper bound to your integral must be around .5, not 1.
integrate(Gauss2F1,lower=0,upper=.5,H=0.7)
0.4954698 with absolute error 5.5e-15
There's a comma missing after sep=).
DBxy-read.csv(paste(C:/users/marta/desktop/DB,filename, sep=)
sep=,,header=TRUE) should be
DBxy-read.csv(paste(C:/users/marta/desktop/DB,filename, sep=),
sep=,,header=TRUE)
^
marta valdes
The Weibull and Gumbel distributions are NOT the same.
Frede Aakmann Tøgersen fr...@vestas.com
Sent by: r-help-boun...@r-project.org
05/14/2014 02:01 AM
To
eliza botto eliza_bo...@hotmail.com, r-help@r-project.org
r-help@r-project.org,
cc
Subject
Re: [R] gumbel distribution
Don't
Check out
http://www.r-bloggers.com/a-million-ways-to-connect-r-and-excel/ for an
overview. See section 4.
Olga Albutova oda...@gmail.com
Sent by: r-help-boun...@r-project.org
04/29/2014 11:05 AM
To
r-help@r-project.org,
cc
Subject
[R] R in Excel
Hello!
I need some help. I'd
The sum-to-zero constraint imposes a loss of one degree of freedom. Of N
samples, only (N-1) can be random. Thus the solution is
N - 100
x - rnorm(N-1)
x - c(x, -sum(x))
sum(x)
[1] -7.199102e-17
Boris Steipe boris.ste...@utoronto.ca
Sent by: r-help-boun...@r-project.org
Then what's wrong with centering your initial values around the mean?
Marc Marí Dell'Olmo marceivi...@gmail.com
04/01/2014 10:56 AM
To
Boris Steipe boris.ste...@utoronto.ca,
cc
jlu...@ria.buffalo.edu, r-help@r-project.org r-help@r-project.org
Subject
Re: [R] A vector of normal distributed
1. To install and run WBugs or Obugs on OSX you must use Parallels or
other Windows emulator.
2. Another possibility is to install JAGS (
http://mcmc-jags.sourceforge.net/) via MacPorts (http://www.macports.org/
) and use R2JAGS.
Agony agony_...@yahoo.com
Sent by:
I too don't understand the error message. However Coefficient Alpha is
easily calculated. To wit:
library(psych)
tt - cbind(c(1,0.58) , c(0.58,1))
colnames(tt) = rownames(tt) = list(V1 , V2)
p - nrow(tt)
alpha - p/(p-1) * (1-sum(diag(tt))/sum(tt))
Numerous caveats regarding using C-Alpha
THE adjusted R^2 is [1-(1-R2)·(n-1)/(n-v-1)], which you call McNemarâs
formula. It was actually proposed first by Fisher in 1924. Theil's
formula is equal to Fisher's.
Wherry's formula, as you give it, is correct but was proposed to estimate
the cross-validated R2, which is different
If the matrix is singular, the determinant of the matrix and its M-P
inverse are both zero.
Sean O'Riordain sean...@acm.org
Sent by: r-help-boun...@r-project.org
03/14/2012 07:41 AM
To
r-help@r-project.org
cc
Subject
[R] Moore-Penrose Generalized determinant?
Is there a function in R
First, be sure your R and the R associated with Rstudio are the same R
versions. In Rstudio, check Tools - Options - R version. It looks as
if your R-studio is running the 32-bit version of R.
Aayush Raman ayushra...@gmail.com
Sent by: r-help-boun...@r-project.org
03/09/2012 07:11 AM
To
I would recommend using the new Bayesian package 'LaplacesDemon' available
on CRAN.
Ben Bolker bbol...@gmail.com
Sent by: r-help-boun...@r-project.org
08/29/2011 02:50 PM
To
r-h...@stat.math.ethz.ch
cc
Subject
Re: [R] Bayesian functions for mle2 object
Billy.Requena billy.requena at
Yes. If you want a program that does some of what Mplus does, use the
lavaan package or the sem package.
Dimitri Liakhovitski dimitri.liakhovit...@gmail.com
Sent by: r-help-boun...@r-project.org
07/18/2011 05:36 PM
To
r-help r-help@r-project.org
cc
Subject
[R] Using Mplus via R
A transcendental number is not the zero of any polynomial with rational,
not just integer, coefficients
.
Ravi Varadhan rvarad...@jhmi.edu
Sent by: r-help-boun...@r-project.org
05/31/2011 10:12 AM
To
'Bentley Coffey' bentleygcof...@gmail.com, Vincy Pyne
vincy_p...@yahoo.ca
cc
Regression for the gamma distribution can be expressed as a generalized
linear model. Check Chapter 8 of McCullagh, P. Nelder, J. A. (1989),
Generalized linear models, Chapman Hall, London, UK.
Walter Anderson wandrso...@gmail.com
Sent by: r-help-boun...@r-project.org
03/29/2011 09:57
lm(y~x+0) yields the regression on x without the constant, i.e., y=bx+e,
not y = a +e
derek jan.kac...@gmail.com
Sent by: r-help-boun...@r-project.org
03/16/2011 03:49 PM
To
r-help@r-project.org
cc
Subject
[R] Strange R squared, possible error
k=lm(y~x)
summary(k)
returns R^2=0.9994
The Lattice auto.key argument has a bug in R.12.2.
R version 2.12.2 (2011-02-25)
Platform: i386-pc-mingw32/i386 (32-bit)
other attached packages:
[1] lattice_0.19-17
loaded via a namespace (and not attached):
[1] grid_2.12.2
If I set up my plot parameters as
require(lattice)
I just found out that the sum of 1+2+3+... is -1/12. !?! Crazy.
Not really. Google on divergent series or Euler summation. The result
explains why bosonic string theory must operate only in 26 dimensions! It
would then appear that ... -3 - 2 - 1 + 0 +1 +2 +3 + ... is zero.
Kjetil et al,
Unlike finite sums, infinite sums are not commutative. To have
commutativity, one must have absolute summability, that is, the sum of the
absolute values of the terms must be finite. If one has absolute
summability, the infinite sum exists and is unique. This sum is not
Clearly inferior treatments are unethical.
Donald Berry at MD Anderson in Houston TX and Jay Kadane at Carnegie
Mellon have been working on more ethical designs within the Bayesian
framework. In particular, response adaptive designs reduce the assignment
to and continuation of patients on
A confidence interval around the p-value makes no sense because there is
no parameter being estimated, but the sampling distribution of the p-value
makes a lot of sense. The pre-observational P-value is a random variable
that is a function of the underlying random variable being tested. That
There are three paths to path analysis in R: the SEM package; the LAVAAN
package; and the OpenMx approach. The first two are R programs. The last
accesses the program OpenMx.
Guy rotem rottem...@gmail.com
Sent by: r-help-boun...@r-project.org
09/06/2010 10:37 AM
To
r-help@r-project.org
The following reference that contains a short Fortran program for the
Brown-Forsythe ANOVA
Reed, James F., I. Stark, D. B.
Robust alternatives to traditional analyses of variance: Welch $W^*$,
James $J_I^*$, James $J_II^*$, and Brown-Forsythe $BF^*$
Computer Methods and Programs in
Yes. I too remember BMD, BMDP, punch cards, computer printouts, and
24-hour turn-around. However, I am also old enough that when someone asks
for an antique method, I will gladly supply it if I can, if only for
historical reasons.
Bert Gunter gunter.ber...@gene.com
08/31/2010 04:41 PM
To
There appears to be a problem in both regressions, as a singularity is
also reported in the second regression analysis as well. It appears that
the litrate variable is considered a factor in the first analysis and
continuous in the second. There also appears to be collinearity between
the
help(integrate)
Nathalie Gimenes ncgmsanc...@gmail.com
Sent by: r-help-boun...@r-project.org
07/19/2010 04:59 PM
To
r-help@r-project.org
cc
Subject
[R] integral in R
Hello All,
I have to create a variable that is a function of another one (already
created), its cumulative
Yes. When my young son told someone that I was a doctor, he had to
further explain I was a number doctor, not a people doctor.
Barry Rowlingson b.rowling...@lancaster.ac.uk
Sent by: r-help-boun...@r-project.org
06/22/2010 09:45 AM
To
Marc Schwartz marc_schwa...@me.com
cc
The closest explanation of the term loess I can find is in Local
regression models by Cleveland, W. S.; Grosse, E. Shyu, W. M. (Chapter
8 of Statistical models in S (1992) by Chambers, J. M. Hastie, T. J.)
... local regression models is called loess, which is short for local
regression,
Ben, Ravi, Chuck, and Haneef,
Note that the standard normal density can be written (in pseudo-TeX) as
1/sqrt(2*pi) * exp[- ( x/sqrt(2) )^2].
The exponential on the right is a special case of the stretched
exponential function
exp[- (x/sqrt(tau))^beta].
The stretched exponential function has
Jay
Unless I have misunderstood some statistical subtleties, you can use the
AIC in place of actual cross-validation, as the AIC is asymptotically
equivalent to leave-out-one cross-validation under MLE.
Joe
Stone, M.
An asymptotic equivalence of choice of model by cross-validation and
Akaike's
What is an easy way to stack a matrix multiple times? E.g. I have a 6x6
matrix that I need to stack vertically 154 times to get a 6*154 by 6
matrix. I would rather not rbind(X,X,...,X) matrices.--Joe
[[alternative HTML version deleted]]
Which in turn reminds me of Box Tiao's line
Since small differences in probability cannot be appreciated by the human
mind, there seems little point in being excessively precise about
uncertainty.
Box, G. E. P. Tiao, G. C. (1973), Bayesian inference in statistical
analysis, Addison-Wesley,
Helen
Your program makes no sense.
Try the following script
I - 10
J - 5
response - matrix(0, 10, 5)
#function for probability of response
#revised but equivalent version of Helen's formula
pij - function(a,b,theta) {1/(1+exp(-a*(theta-b)))}
a - rnorm(J, 0.8, 0.04)
a
b - rnorm(J, 0, 1)
b
?density
?max
Rahim Alhamzawi rahimalhamz...@yahoo.co.uk
Sent by: r-help-boun...@r-project.org
12/09/2009 05:23 AM
To
r-h...@stat.math.ethz.ch
cc
Subject
[R] code
Dear support,
I want to compute the highest probability density for any data. please do
you have any code to help me in
You need to give your criteria for preferable. For normal-linear
models, REML estimates of variances are unbiased, whereas ML estimates are
downwardly biased. My intuition is that the ML-induced bias would be
worse in small samples. I don't know about other distributions. Likewise I
don't
Guido wrote
However, using a transformation matrix one can transform a model assuming
unequal variances into an equivalent model assuming equal variances. On
such a transformed model the F test or T test can be applied.
This is indeed news to me. I thought such transformations for unequal
The BIC (Raftery) can be used for quasi-Bayesian model selection, but it's
not stepwise. Ntzoufras shows how to use WinBUGS to conduct Bayesian
model selection, but again it's not stepwise
Ntzoufras, I. (2002), 'Gibbs variable selection using BUGS', Journal of
Statistical Software 7(7),
Rescale your data x to (x-A)/(B-A).
Maithili Shiva maithili_sh...@yahoo.com
Sent by: r-help-boun...@r-project.org
10/07/2009 08:39 AM
To
r-help@r-project.org
cc
Subject
[R] Parameters of Beta distribution
Supose I have a data pertaining to credit loss as
amounts -
The downloaded packages are in
C:\Documents and Settings\jlucke\Local
Settings\Temp\RtmpRAkMZy\downloaded_packages
updating HTML package descriptions
BUT,
library(rjags)
Error in fun(...) : Failed to locate JAGS 1.0.3 installation
Error : .onLoad failed in 'loadNamespace' for 'rjags'
Error: package
Use polr from the MASS package
Nimal Fernando pnp...@gmail.com
Sent by: r-help-boun...@r-project.org
09/25/2009 12:33 PM
To
r-help@r-project.org
cc
Subject
Re: [R] Logistic Regression for Multinomial Data using R
Hi
I want to do logistic regression for multinomial data.
How can I do
Lucas
This problem is very old --- older than keypunches. There are several
methods for selecting variables (forward, backwards, both, all subsets)
using a variety of criteria (p-values, R^2, adjusted R^2, Cp, AIC, BIC,
and more). Be sure you understand the methods, especially the tendency to
Dr Shen
Even though you pose 3 contrasts, there are only 2 degrees of freedom as
the 3rd contrast is the sum of the first two. Your aov output states this
as StdLot has only 2 df. Having used up your df, the aov has nothing to
report.
Joe
Joseph F. Lucke
Senior Statistician
Research
I am late to this discussion so forgive me if I am being redundant. It
appears to me that the integral from 0 to infinity of log-gamma may
diverge to infinity. Equation 6.1.50 of Abramowitz Stegun shows that a
re-expression of lnGamma(x) and the Stirling approximation involves
I am late to this discussion so I apologize if what I say has already been
noted. The function below does NOT require large factorials, but very
small reciprocal of factorials. Thus if v2 would be replaced with
something like exp(-lgamma(i-n+m+1)-lgamma(m+1)) and checked for underflow
(ie
The modified function I presented contains a stupid error, which is
corrected below.
sum1 - function(l,u,t,i,n,w,tol=.Machine$double.xmin) {
v - 0
v2 - 1
for (m in 0 :w v2 tol) {
v1 - ((u^(1/2))*(l^(1/2))*t)^(i-n+2*m)
v2 - exp(-lgamma(i-n+m+1)-lgamma(m+1))
v3 - v1*v2
v - v+v3
}
return(v)
IMHO, you should consult an advanced text on calculus with integration
over infinite intervals, so that you understand what you are trying to do.
Joseph F. Lucke
Senior Statistician
Research Institute on Addictions
University at Buffalo
State University of New York
1021 Main Street
Buffalo, NY
You can export the Maple code to C or Fortran. I actually found it easier
to export it to Fortran and then use a text editor to change Fortran's
assignment ='s to R's -. After additional tweaks for R, you can convert
the script into an R function.
Joseph F. Lucke
Senior Statistician
I forgot. You can get the Bessel functions from Robin Hankin's GSL
package.
R. K. S. Hankin 2006. Introducing gsl, a wrapper for the Gnu Scientific
Library. Rnews 6(4):24-26
Joseph F. Lucke
Senior Statistician
Research Institute on Addictions
University at Buffalo
State University of New
guRus:
I have a variable beta as an argument to R's beta function. So
essentially I have a case of beta(alpha, beta). What surprises me is that
R doesn't barf on this stupid programming practice. R gets the right
answer. How does R know beta the variable from beta the function?
Joseph F.
A solution using a toy example
r - cor(mvrnorm(1000,mu=rep(0,10),Sigma=diag(10))) #assume a 10 x 10
matrix
j - i-1:dim(r)[1] #generate matrix indices
lt - outer(i,j,'') #get boolean lower triangle
sort(r[lt],decreasing=TRUE)[1:5] #extract top 5 correlations
Joseph F. Lucke
Senior
I am unable to install the rggobi package. I do not have trouble
installing other packages. Any advice or suggestions?
sessionInfo()
R version 2.8.1 (2008-12-22)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
Generally smart people,
I need a recent reference for using the Schwarz/Bayesian information
criterion for model fitting in a frequentist stepwise regression.
Joe
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
LaTeX offers a verbatim environment.
\begin{verbatim}
This is maintained verbatim, Latex commands and environments are typeset
as written without any processing.
\end{verbatim}
Be sure to use the package verbatim.
---Joe
Peter Dunn pdu...@usc.edu.au
Sent by: r-help-boun...@r-project.org
Use the include function in LaTeX.
Christopher W. Ryan cr...@binghamton.edu
Sent by: r-help-boun...@r-project.org
01/27/2009 12:48 PM
To
r-h...@stat.math.ethz.ch
cc
Subject
[R] using Sweave with a master file that has several iputted .tex files
Suppose I have a Master.Rnw file that
Although I have installed R many times on many machines without problems,
I have recently encountered a problem with accessing packages. R has been
installed successfully with the --internet2 option. The session info is
below.
sessionInfo()
R version 2.8.1 (2008-12-22)
i386-pc-mingw32
76 matches
Mail list logo