Question

data <- read.table(practicedata.cvs) # Calculate the mean, max, min, median, and sum of column "K5". If...

data <- read.table(practicedata.cvs)

# Calculate the mean, max, min, median, and sum of column "K5". If there is any NA, please ignore them.

# Draw any figure to describe column "K5".

# Print all rows with "Play" is 1, "K1" is 1, and "K5" is NA.

# Print the row of the first time in which sum of K1, K2, ..., K11 larger than 45.

# Print the last row you find that sum of K1, K2, ..., K11 is larger than 45.

Homework Answers

Answer #1

As the language is not mentioned
Assuming matlab
as wrote as table

%Assuming T is table
rows = (T.k5 ~= 'NA');
k5 = T.k5(rows);
mean(k5)
max(k5)
min(k5)
median(k5)
sumk5 = sum(k5);
% use plot or boxplot

boxplot(k5)

%
rows = (T.k5 == 'NA') && (T.Play ==1) && (T.K1 ==1);
tablerows = T(rows,:);
%
tablesplit = T(:,{k1:k11});
summed = sum(tablesplit,2);
summed = [summed >45];
%iterate summed to find ur requirement

for i=1:len(summed)
   if summed(i)
     print(T(i,:))

for i =1:len(summed)
   j = len(summed) + 1 -i;
   if summed(j)
     print(T(j,:))
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT