|
|
z scores without the stats toolbox
Hi,
Im trying to calculate z scores in matlab (I don't have the statistics toolbox)
I have a matrix of 20 x 40 called 'nt'
I have used the following code
nt_s = std(nt(:));
nt_mu = mean(mean(nt));
x=nt-nt_mu;
nt_z=x./nt_s;
but this only gives me z scores for each column, when I actually want a zscore for each individual score in the matrix.
Any ideas?
Also I would like an easy way of finding what values in the z score matrix are > +3 and < -3
I only know how to type Z = nt_Z > 3 and Z = nt_z < -3 separately.
These are probably very easy questions, but Im very new to matlab
Thanks for your help
|
|
0
|
|
|
|
Reply
|
Tracey
|
3/6/2010 2:54:03 PM |
|
Tracey wrote:
> Hi,
> Im trying to calculate z scores in matlab (I don't have the statistics
> toolbox)
> I have a matrix of 20 x 40 called 'nt'
> I have used the following code
>
> nt_s = std(nt(:));
> nt_mu = mean(mean(nt));
> x=nt-nt_mu;
> nt_z=x./nt_s;
> but this only gives me z scores for each column, when I actually want a
> zscore for each individual score in the matrix. Any ideas?
Over what population should the means/variance be calculated for the
standardized variate to be referenced?
If it's the global...oh, I just reread the first line--you did that for
s via the (:) and by the repeat of mean for mu. I'd have probably
written it as
mean(nt(:))
as well, but the result is the same it only avoids the nested call this way.
Well, let's see...
x should be size of nt and thus
nt_z should be as well.
What does
size(nt_z)
return? Looks to me like it ought to be same as size(nt) unless I
missed something or you did something other than shown.
> Also I would like an easy way of finding what values in the z score
> matrix are > +3 and < -3
>
> I only know how to type Z = nt_Z > 3 and Z = nt_z < -3 separately. These
> are probably very easy questions, but Im very new to matlab
You can write a compound condition or you could use
Z = nt_z(abs(nt_z>3));
also
doc find
might be of interest as could be the section in the "Getting Started"
chapter on logical addressing.
--
|
|
0
|
|
|
|
Reply
|
dpb
|
3/6/2010 3:30:29 PM
|
|
dpb wrote:
....
>> Also I would like an easy way of finding what values in the z score
>> matrix are > +3 and < -3
>>
>> I only know how to type Z = nt_Z > 3 and Z = nt_z < -3 separately.
>> These are probably very easy questions, but Im very new to matlab
>
> You can write a compound condition or you could use
>
> Z = nt_z(abs(nt_z>3));
....
ooops...
> Z = nt_z(abs(nt_z)>3);
--
|
|
0
|
|
|
|
Reply
|
dpb
|
3/6/2010 5:58:52 PM
|
|
dpb <none@non.net> wrote in message <hmtsha$tui$1@news.eternal-september.org>...
> Tracey wrote:
> > Hi,
> > Im trying to calculate z scores in matlab (I don't have the statistics
> > toolbox)
> > I have a matrix of 20 x 40 called 'nt'
> > I have used the following code
> >
> > nt_s = std(nt(:));
> > nt_mu = mean(mean(nt));
> > x=nt-nt_mu;
> > nt_z=x./nt_s;
>
> > but this only gives me z scores for each column, when I actually want a
> > zscore for each individual score in the matrix. Any ideas?
>
> Over what population should the means/variance be calculated for the
> standardized variate to be referenced?
>
> If it's the global...oh, I just reread the first line--you did that for
> s via the (:) and by the repeat of mean for mu. I'd have probably
> written it as
>
> mean(nt(:))
>
> as well, but the result is the same it only avoids the nested call this way.
>
> Well, let's see...
>
> x should be size of nt and thus
>
> nt_z should be as well.
>
> What does
>
> size(nt_z)
>
> return? Looks to me like it ought to be same as size(nt) unless I
> missed something or you did something other than shown.
Hi thanks for your reply. Apologies for my delayed response.
You're right, I had made a mistake in the file that I entered (nt was the mean of another file) - whoops!
thanks for your suggestion for further reading. I'll look that up
Tracey
>
>
> > Also I would like an easy way of finding what values in the z score
> > matrix are > +3 and < -3
> >
> > I only know how to type Z = nt_Z > 3 and Z = nt_z < -3 separately. These
> > are probably very easy questions, but Im very new to matlab
>
> You can write a compound condition or you could use
>
> Z = nt_z(abs(nt_z>3));
>
> also
>
> doc find
>
> might be of interest as could be the section in the "Getting Started"
> chapter on logical addressing.
>
> --
|
|
0
|
|
|
|
Reply
|
Tracey
|
3/9/2010 8:54:04 AM
|
|
|
3 Replies
387 Views
(page loaded in 0.241 seconds)
Similiar Articles: Statistics area from z-score function - comp.sys.hp48fitting with the custom model without using CurveFittingToolbox ... Statistics area from z-score function - comp.sys.hp48 Statistics area from z-score function - comp.sys ... Simple linear regression in Curve Fitting Toolbox - comp.soft-sys ...... of lines that are available in the Curve Fitting Toolbox ... is that the predictor has been standardized (a Z-score ... fitting with the custom model without using ... PCA plot - comp.soft-sys.matlab... is a biplot, and if you have access to the Statistics Toolbox ... soft-sys.matlab It's too difficult to observe without ... Produces a z-score plot (conformer plot) and an ... The Inverse cumulative distribution function for Inverse Gaussian ...There are two things you might do, assuming you have access to the Statistics Toolbox ... Statistics area from z-score function - comp.sys.hp48 cumulative bivariate ... Model a function fitting the data - comp.soft-sys.matlab ...fitting with the custom model without using CurveFittingToolbox ... Dear All, I ... Fitting Toolbox can solve surface fitting problems: model z = f(x,y) 2. Statistics Toolbox ... calculating 95-percentile for a non-Gaussian distribution - comp ...If you have access to the Statistics Toolbox, >> help ... Can you locate the 95-percentile without ... Statistics area from z-score function - comp.sys.hp48 calculating 95 ... Using fuzzy logic to solve a third degree polynomial function ...Have you taken a look at the demos that come with Fuzzy Logic Toolbox? ... Using the Solver within a program - comp.sys.hp48 Statistics area from z-score function - comp ... How to compute confidence interval of the mean - comp.soft-sys ...... how to conveniently compute CI of mean, without ... If you have access to the Statistics Toolbox, it has functions ... of the ... discard the lowest and the highest scores ... statistical t test to compare two groups - comp.soft-sys.matlab ...If you have the Statistics Toolbox, >> help ttest2 TTEST2 Two-sample t-test with ... QUERY: Logrank scores -- SAS vs PROC StatXact - comp.soft-sys.sas ... Dear all ... hp equation solve library card - comp.sys.hp48In the HP-48G/GX the EQLIB is already built in, also without the periodic table that can be downloaded on hpcalc. When the HP-48SX was launched, HP offered the EQLIB for ... 7/26/2012 9:56:26 AM
|
|
|
|
|
|
|
|
|