Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 months ago.
Improve this question
I am trying to follow chapter 2 on SDT in
https://link.springer.com/chapter/10.1007/978-3-030-03499-3_2
It basically says
d'emp = z(HIT) - z(FA)
if you don't know z() let your computer compute it ..
But how? Is there a function in R? It cannot be scale becaus Hit and FA are single values.
In this book, the z-transformation z() is defined as "the inverse cumulative Gaussian function". I think the sentence "If you are not familiar with the z-transformation just treat it as a function you can find on your computer" means for readers to not stop too much time in what does z-transformation means and pay attention to the calculations of d_emp and b_emp as the differences and the average.
However, if you want to know how to compute the inverse cumulative Gaussian (normal) function, you can use qnorm() from statslibrary. Be aware that you have to specify the mean and sd of the population, by default the function takes mean = 0 and sd = 1.
To know more:
Inverse of the cumulative gaussian distribution in R
https://www.statology.org/dnorm-pnorm-rnorm-qnorm-in-r/
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
the "mixedDesign" function was written by the professor for this homework, but I think the argument "sd" is standard as I've found it on other functions but with no description of what the value should actually describe. What am I actually saying when I designate a value for sd? Professor says 0.1 is "too low". Is there a standard value for this argument?
simdata <- mixedDesign(B=c(2, 2), W=2, n=10, M=Means,
SD=0.1, R=.42, empirical = TRUE, long = TRUE)
I'm aware that standard deviation is 34.1% either side of the mean!
Many thanks in advance!
A bit of googling leads here:
SD: Matrix specifying the cell standard deviations of crossing between- and within-subject factors (dimensions: prod(B)-by-prod(W) matrix)
(for pure within-subjects designs, it is possible to input a vector of size prod(W) as an alternative to a 1-by-prod(W) matrix) OR
a scalar (single number) that will be the standard deviation of all cells
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have to calculate the probability distribution function of a random variable that is composed of (sum, division, product, exponentiation, etc...) some other simple random variables. It is pretty complex so I am morte then happy to get a numerical solution
While thought this was a very standard thing to do , I was unable to find a framework to do that. I'd preferably use R, but any major language will do.
What I would like therefore is a library that allowed me to:
i) create numerical random variables from classic distributions
ii) compose them by simple operations (+,-,*,/, exp,min, max,...)
Of course I could work with vectors and use convolutions and the like, but I wanted something more polished.
I am also aware that is possible to use simulation to create the variables, then compose them with the operations and finally getting the PDF using a histogram, but again, I would prefer a non - simulating approach.
Try the rv package. Note that if X is an exponential random variable with mean 1, then -log(X) has a standard Gumbel distribution.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I'm not sure if this is a question for stackoverflow, or crossvalidated.
I'm looking for away to include covariate measures when calculating the correlation between two measures. For example, Lets say I have 100 samples, for which I have two measurements, x and y. Now lets say I also have a third measure, a covariate (lets say age). I want to measure the correlation between x and y, but I also want to ignore any of that correlation that comes from the covariate, age.
If I'm fitting a linear model, I could simply add the term to the model:
lm(y~x+age)
I know you can't calculate correlation with this kind of model in R (using ~).
So I want to know:
Does what I'm asking even make sense to do? I suspect it may not.
If it does, what R packages should I be using?
It sounds like you're asking for a semipartial correlation. You want the correlation between x and y partialling out the correlation between x and z. You need to read about partial and semipartial correlations.
The ppcor package in R will then help you with the calculations.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
In help(predict.lars) we can read that the parameter s is "a value, or vector of values, indexing the path. Its values depends on the mode= argument. By default (mode="step"), s should take on values between 0 and p (e.g., a step of 1.3 means .3 of the way between step 1 and 2.)"
What does "indexing the path" mean? Also, s must take a value between 1 and p, but what is p? The parameter p is not mentioned elsewhere in the help file.
I know this is basic, but there is not a single question up on SO about predict.lars.
It is easiest to use the mode="norm" option. In this case, s should just be your L1-regularization coefficient (\lambda).
To understand mode=step, you need to know a little more about the LARS algorithm.
One problem that LARS can solve is the L1-regularized regression problem: min ||y-Xw||^2+\lambda|w|, where y are the outputs, X is a matrix of input vectors, and w are the regression weights.
A simplified explanation of how LARS works is that it greedily builds a solution to this problem by adding or removing dimensions from the regression weight vector.
Each of these greedy steps can be interpreted as a solution to a L1 regularized problem with decreasing values of \lambda. The sequence of these steps is known as the path.
So, given the LARS path, to get the solution for a user-supplied \lambda, you iterate along the path until the next element is less than the input \lambda, then you take a partial step (\lambda decreases linearly between each step).
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
My question deals with the fracdiff.sim function in R (in the fracdiff package) for which the help document, just like for arima.sim, is not really clear concerning initial values.
It's ok that stationary processes do not depend on their initial values when time grows, but my aim is to see in my simulations the return of my long memory process (fitted with arfima) to its mean.
Therefore, I need to input at least the p final values of my in-sample process (and eventually q innovations) if it is ARFIMA(p,d,q). In other words, I would like to set the burn-in period's length to 0 and give starting values instead.
Nevertheless, I'm currently not able to do this. I know that fracdiff.sim makes it possible for the user to chose the length of a burning period (which leads to the stationnary behavior) and the mean of the simulated process (it is simulated and then translated to make the means match). There is also a condition: the length of the burn-in period must be >= p+q. What I suppose is that there is something to do with the innov argument but I'm really not sure.
This idea is inspired by the arima.sim function which has a start.innov argument. However, even if my aim was to simulate an ARMA(p,q), I'm not sure of the exact use of this argument (the help is quite poor) : must we input only q innovations ? put with them the p last values of the in-sample process ? In which order ?
To sum up, I want to simulate ARFIMA processes starting from a specific value and having a specific mean in order to see the return to the mean and not only the long term behavior. I fund beginnings of solutions for arima.sim on the internet but nobody clearly answered, and if the solution uses start.innov, how to solve the problem for ARFIMA processes (fracdiff.sim doesn't have the start.innov argument) ?
Hopping I have been clear enough,