Displaying 20 results from an estimated 7000 matches similar to: "Have problem to do loop to generate transformed chi-squared variates"
2007 Sep 11
1
Fitting Data to a Noncentral Chi-Squared Distribution using MLE
Hi, I have written out the log-likelihood function to fit some data I have (called ONES20) to the non-central chi-squared distribution.
>library(stats4)
>ll<-function(lambda,k){x<-ONES20; 25573*0.5*lambda-25573*log(2)-sum(-x/2)-log((x/lambda)^(0.25*k-0.5))-log(besselI(sqrt(lambda*x),0.5*k-1,expon.scaled=FALSE))}
> est<-mle(minuslog=ll,start=list(lambda=0.05,k=0.006))
2010 Aug 17
2
plotting functions of chi square
Hi! This is going to be a real newbie question, but I can't figure it out.
I'm trying to plot densities of various functions of chi-square. A simple
chi-square plot I can do with dchisq(). But e.g. chi.sq/degrees of freedom I
only know how to do using density(rchisq()/df). For example:
plot(1, type="n", xlab="", ylab="", xlim=c(0,2), ylim=c(0,7))
for (i
2012 Dec 25
1
Sampling data without having infinite numbers after diong a transformation
Hello R-helpers..
I want to ask about how I can sample data sets without having the infinite numbers coming out. For example,
set.seed(1234)
a<-rnorm(15,0,1)
b<-rnorm(15,0,1)
c<-rnorm(15,0,1)
d<-rnorm(15,0,36)
After come out with the sample, I need to do a transformation (by Hoaglin, 1985) for each data set. Actually I need to measure the skewness and kurtosis, that's why I
2001 Oct 21
3
generating a gamma random variable
Dear R People,
This question has nothing to do with R directly, but it is a simulation
question. I need to generate a random variable distributed as
gamma(\alpha,\beta), with the additional proviso that it must be a
function of random variable(s) which do not depend on \alpha, \beta. In
this case, I have \alpha = (T-1)/2, where T is a positive integer.
So, it seems reasonable to first simulate
2002 Sep 30
5
Chi-Square Distribution Plots
Dear list
I have a vector of values that allegedly have a chi-squared distribution. I
want to create a plot that shows the values I have obtained, and the
chi-squared distribution curve for the specified number of degrees of freedom
to show what should have been obtained.
At the moment I am plotting the values I have obtained as a histogram and
somehow want to put on to this plot the
2013 Jan 13
1
How to combine two loops?
Hello R-helpers,
I want to ask your opinion since I am not so sure how to do it. This is regarding one part of my paper project and my situation is:
Stage I
I have 2 groups and for each group I need to compute the following steps;
i) Generate 3 random numbers from normal distribution and square them.
ii) Repeat step 1 for 15 times and at the end I will get 15 random numbers.
I already done
2008 Oct 25
2
how to plot chi-square distribution in the graph
if i want to plot the chi-square distribution with a different degree of
freedom how can i plot it in the graph?Sometimes i plot the histogram and
cut it in a lot of piece.It's distribution like a chi-square.So i want to
plot the chi-square with a different degree of freedom to compare it .
--
View this message in context:
2007 Sep 11
0
Fitting data to chi-squared or noncentral chi-squared distributions
Does anybody have any experience fitting data to the non-central chi-squared or chi-squared distribution? I am trying to fit some data to this distribution but there is error after error.
audaces fortuna iuvat
---------------------------------
[[alternative HTML version deleted]]
2003 Apr 11
1
Pearson's Chi-squared Test
How i can perform a Pearson's Chi-squared Test in this data set:
| Outcome
-----------------+-----------+----------------------------------+
Treatment | Sex | None |Some | Marked | Total
-----------------+------------+--------+--------+-------------+
Active | Female | 6 | 5 | 16 | 27
2008 Jan 15
2
In chisq.test(x) : Chi-squared approximation may be incorrect
Hello,
I received the following warning when running chi-square;
n Is there a way to catch the 'error' code of 'warning' after run
chisq.test(x)?
n What does this error mean?
Thank you for your help.
[[alternative HTML version deleted]]
2009 Nov 05
1
partitioning chi-square statistic (g squared)
hi all -
is there a package or library that contains a function for partitioning the
chi-square statistic of an I X J contingency table into its respective
independent parts?
i looked around for this, but i didn't find anything. perhaps there's
another name for this sort of analysis? i know it as "g-squared".
thanks,
chris.
[[alternative HTML version deleted]]
2010 Mar 01
1
Fitting chi-squared distribution
Dear all,
I have a question regarding performing test if the data fits chi-squared
distribution.
For example, using ks.test()
I found in the examples how to fit it to gamma or weibull
x<-rnorm(100)
ks.test(x, "pweibull", shape=2,scale=1)
for the gamma, pgamma can be used
But I cannot find the value of this second parameter for the chi-squared
distribution.
Maybe someone
2009 Jul 23
1
goodfit() in vcd package: computation of chi-squared
I have troubles understanding how goodfit() function in the vcd package
computes the Pearson coefficient. Can anybody provide more information
on the computation?
In particular, for HorseKicks data in vcd package, goodfit() yields
> oo <- goodfit(HorseKicks,type="poisson",method="MinChisq")
> summary(oo)
Goodness-of-fit test for poisson distribution
2011 Mar 04
1
Question in Chi-squared test, can I do it with percentage data?
Hi all,
I know Chi-squared test can be done with the frequency data by R function
"chisq.test()", but I am not sure if it can be applied to the percentage
data ? The example of my data is as follow:
#############################################
KSL MHL MWS CLGC LYGC
independent (%) 96.22 92.18 68.54 93.80 85.74
2005 Nov 24
2
Chi-squared test
Hello,
I'm trying to calculate a chi-squared test to see if my data are
different from the theoretical distribution or not:
chisq.test(rbind(c(79, 52, 69, 71, 82, 87, 95, 74, 55, 78, 49,
60),c(80,80,80, 80, 80, 80, 80, 80, 80, 80, 80, 80)))
Pearson's Chi-squared test
data: rbind(c(79, 52, 69, 71, 82, 87, 95, 74, 55, 78, 49, 60), c(80,
80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
2010 Jan 29
1
two sample chi-squared test
Hello,
Can you tell me what R function to use to do a two-sample chi-squared
test? I want to see if two distributions are significantly different
from each other, and I don't specify the theoretical distribution of
either. For example, I have the following fake count data:
x <- sample(1:10,50,replace=TRUE)
y <- sample(1:10,100,replace=TRUE)
I saw chisq.test in the stats package, but
2011 Jan 06
1
need help for chi-squared test
I've got a dataset which looks like this in the beginning:
cbr dust smoking expo
1 0 0.20 1 5
2 0 0.25 1 4
3 0 0.25 1 8
4 0 0.25 1 4
5 0 0.25 1 4
(till no. 1240, anyway, a huge set)
I have to analyse cbr and smoking, I know it works with chisq.test() for the
whole set, but I only need cbr and smoking, and I
2009 Feb 05
1
Chi-squared test adjusted for multiple comparisons? Harbe's test?
Hi!
I have some data that looks like this
up down percentaje
uew_21 20 14 58.82
uew_20_5 27 40 40.29
uew_20 8 13 38.09
uew_19_5 17 42 28.81
So I have 4 experimental conditions and I am counting number of
animals in the up and down compartment and the calculating the
percentage, I want to know which one of the conditions is different
from each other. If the data wouldn't be percentage
2005 Jan 21
0
R: chi-Squared distribution
Hi,
Attention chi-squared distribution, unlike F
distribution, has only df1 as parameter, not df1 and
df2. So correct into:
outer(1:3, 1:3, function(df1, df2) qchisq(0.95, df1,
df2))
outer(1:3, 1:3, function(df1, df2) qchisq(0.95, df1))
^^^^^^^^^^^^^^^^^^^^
Regards,
Vito
you wrote:
Dear Rs:
outer(1:3, 1:3, function(df1, df2) qf(0.95, df1, df2))
I compare this F
2005 Jan 21
0
R: chi-Squared distribution in Friedman test
Hi,
pchisq -> distribution function
dchisq -> density function
pval is the area under the curve, to calculte it you
use distribution function which is the integral of
density function. See:
http://www.itl.nist.gov/div898/handbook/eda/section3/eda362.htm
http://mathworld.wolfram.com/DistributionFunction.html
f(x) density function
F(x) distribution function =Pr(X<x)= integral(f(x))