I would like to find and plot the means and standard deviations for lots of columns of data.
I have gone over and over this, but I can’t seem to figure out what is going on. Eventually, I would like to plot the mean of 3 columns of data, based on their category. There are four categories, Spring, Summer, Winter, Autumn. I can import the data from excel, find the variable names, and recreate the table with just the data I want, but I can’t seem to find a way to calculate the mean based on the category. For example, I want to find the mean for all Spring for each of the final three columns. This is just one set of data. There are 8 total sets (all different lengths), so eventually, I would like to plot all of them, but I thought I would just start with 1 set. At this stage, if I can get to show the mean for table A, that would be great. Please help me get the means and standard deviations.
T = readtable(‘SdAlphabetSeasons.xlsx’);
T.Properties.VariableNames
Season = T(:,4);
dD = T(:,5);
d18O = T(:,6);
xs = T(:,7);
A = table(Season,dD,d18O,xs);
SSNMean = grpstats(A,"Season");
Function ‘subsindex’ is not defined for values of class ‘string’.
Error in dsgrpstats (line 97)
[group,glabel,groupname] = mgrp2idx(a_data(groupvars),a_nobs);
Error in grpstats (line 136)
[varargout{1:nargout}] = dsgrpstats(x,group,whichstats,varargin{:});I have gone over and over this, but I can’t seem to figure out what is going on. Eventually, I would like to plot the mean of 3 columns of data, based on their category. There are four categories, Spring, Summer, Winter, Autumn. I can import the data from excel, find the variable names, and recreate the table with just the data I want, but I can’t seem to find a way to calculate the mean based on the category. For example, I want to find the mean for all Spring for each of the final three columns. This is just one set of data. There are 8 total sets (all different lengths), so eventually, I would like to plot all of them, but I thought I would just start with 1 set. At this stage, if I can get to show the mean for table A, that would be great. Please help me get the means and standard deviations.
T = readtable(‘SdAlphabetSeasons.xlsx’);
T.Properties.VariableNames
Season = T(:,4);
dD = T(:,5);
d18O = T(:,6);
xs = T(:,7);
A = table(Season,dD,d18O,xs);
SSNMean = grpstats(A,"Season");
Function ‘subsindex’ is not defined for values of class ‘string’.
Error in dsgrpstats (line 97)
[group,glabel,groupname] = mgrp2idx(a_data(groupvars),a_nobs);
Error in grpstats (line 136)
[varargout{1:nargout}] = dsgrpstats(x,group,whichstats,varargin{:}); I have gone over and over this, but I can’t seem to figure out what is going on. Eventually, I would like to plot the mean of 3 columns of data, based on their category. There are four categories, Spring, Summer, Winter, Autumn. I can import the data from excel, find the variable names, and recreate the table with just the data I want, but I can’t seem to find a way to calculate the mean based on the category. For example, I want to find the mean for all Spring for each of the final three columns. This is just one set of data. There are 8 total sets (all different lengths), so eventually, I would like to plot all of them, but I thought I would just start with 1 set. At this stage, if I can get to show the mean for table A, that would be great. Please help me get the means and standard deviations.
T = readtable(‘SdAlphabetSeasons.xlsx’);
T.Properties.VariableNames
Season = T(:,4);
dD = T(:,5);
d18O = T(:,6);
xs = T(:,7);
A = table(Season,dD,d18O,xs);
SSNMean = grpstats(A,"Season");
Function ‘subsindex’ is not defined for values of class ‘string’.
Error in dsgrpstats (line 97)
[group,glabel,groupname] = mgrp2idx(a_data(groupvars),a_nobs);
Error in grpstats (line 136)
[varargout{1:nargout}] = dsgrpstats(x,group,whichstats,varargin{:}); table, mean, standard deviation, grpstats MATLAB Answers — New Questions