Meaning of sd argument in R function: "sd=" [closed] - r

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

Related

z() function Signal Detection Theory in R [closed]

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/

Mathematical formula required [closed]

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
An input sequence is given. Each stage of the iteration finds another sequence by calculating difference between n-i and n-i-1 number. We continue the process and at the end of the last iteration (iteration: n-1) we find only 1 number. What is the mathematical formulation for finding the last number as shown in the image?
Basically, the mathematical formulation is finding the n-1'th derivative of the degree-n-1 polynomial passing through all points (i,arr[i]). That derivative is guaranteed to be a constant. This is equivalent to the coefficient of the term with exponent n-1, divided by (n-1)!.
This method is a special case of what is known as Neville's Algorithm.

How to work with numeric probability distribution functions [closed]

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.

how to deal with NaN, Na and Inf to calculate mean in R? + after measuring community detection metrics [closed]

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 8 years ago.
Improve this question
my question is that , what is the best way or the right way to deal with NaN and NA and Inf to calculate mean in R:
change Inf to NA also and as is.Na(NaN) is TRUE also, simply use the na.rm= TRUEin mean Function or
change all to zero and then calculate the mean function.
values that I want to calculate mean for are the values comes from measuring conductance and expansion for community detection algorithm as defined here
Thanks
Well, I would distinguish between the cases of NA/NaN/Infinity and the rest. I would certainly not convert them to zero as this would distort the result significantly while at the same time, not having any real mathematical sense.
If a value is NA, then it is not, as the name suggests, available
If it is NaN, then it is not a number
And Inf... well, it's infinity.
In all these cases you cannot get an average. Exclude them, and perhaps try to see why they appear (if you can, have to, need to, etc).

Fitting repeated measures in R [closed]

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 9 years ago.
Improve this question
Fitting repeated measures in R, convergence issues. I have the following fit which is one of many datasets and it doesn't converge. I do other sets that do. This dataset and model work in SAS... Could I get some direction in what to do to have this work in R? Things to look at (matrices,option settings,a reference on this topic for r/splus ...).
fit.gls <- gls(resp~grpnum+grpnum/day,data=long, corr=cormat,na.action=na.omit)
Error in glsEstimate(object, control = control) :
computed "gls" fit is singular, rank 62
I have read the following and still trying to work thru it...
Converting Repeated Measures mixed model formula from SAS to R
The problem is the data. gls needs to invert a matrix to work (see Wikipedia for the formula to estimate the covariates). For you particular data set, that matrix is not invertible.
You can allow for singular values to be allowed with the control argument:
fit.gls <- gls(resp~grpnum+grpnum/day,data=long, corr=cormat,na.action=na.omit,
control = list(singular.ok = TRUE))
Be careful with this as you may get bad results! Always check the model fit afterwards.
Look at the help for gls and glsConrol for more details about options.

Resources