Questions
The following R code sorts each vector in a list (lst) and stores the new list...

  1. The following R code sorts each vector in a list (lst) and stores the new list in lst1. The code uses a for loop.

    lst <- list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE))
    lst1 <- list()
    for(i in 1:length(lst))
    {
    lst1[[i]] <- sort(lst[[i]])
    }
    lst1

    Which of the following options does the same thing as the given R code above ?

    lst <- list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE))
    library(purrr)
    lst1 <- map(lst,sort)
    lst1

    lst <- list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE))
    library(purrr)
    lst1 <- map_dbl(lst,sort)
    lst1

    None of the given options

    lst <- list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE))
    library(purrr)
    lst1 <- map_int(lst,sort)
    lst1

5 points   

QUESTION 2

  1. Match the R code on the left (with loop) to its equivalent one (without loop) on the right.

          -       A.       B.       C.   

    V <- c(1,NA,0,4,-1,2)

    y <- c()
    for(i in 1:3)
    {
    y <- c(y,V[i])
    }

          -       A.       B.       C.   

    V <- c(1,NA,0,4,-1,2)

    y <- c()
    for(i in 1:4)
    {
    y <- c(y,V[i])
    }

          -       A.       B.       C.   

    df <- data.frame(col1 = sample(1:3,3,replace=FALSE),
                     col2 = sample(1:3,3,replace=FALSE),
                     col3 = sample(1:3,3,replace=FALSE))

    y <- c()
    for(i in 1:ncol(df))
    {
    y <- c(y,sum(df[,i]))
    }

    A.

    V <- c(1,NA,0,4,-1,2)

    y <- V[1:3]

    B.

    df <- data.frame(col1 = sample(1:3,3,replace=FALSE),
                     col2 = sample(1:3,3,replace=FALSE),
                     col3 = sample(1:3,3,replace=FALSE))

    y <- colSums(df)

    C.

    V <- c(1,NA,0,4,-1,2)

    y <- V[1:4]

15 points   

QUESTION 3

  1. Match the R code with the value of x

    (Here: try to work out the solution with hand and double check by running the code. Don't just run the code and get the answer without understanding the logic)

          -       A.       B.       C.       D.   

    V <- c(1,NA,0,4,-1,2)
    for(i in 1:3)
    {
    y <- V[i]  
    }
    x <- y

          -       A.       B.       C.       D.   

    V <- c(1,NA,0,4,-1,2)
    for(i in 1:4)
    {
    y <- 1
    }
    x <- y
    x

          -       A.       B.       C.       D.   

    df <- data.frame(col1 = sample(1:3,3,replace=FALSE),
                     col2 = sample(1:3,3,replace=FALSE),
                     col3 = sample(1:3,3,replace=FALSE))
    for(i in 1:ncol(df))
    {
    y <- sum(df[,i])
    }
    x <- y
    x

          -       A.       B.       C.       D.   

    library(purrr)
    df <- data.frame(col1 = sample(1:4,4,replace=FALSE),
                     col2 = sample(1:4,4,replace=FALSE),
                     col3 = sample(1:4,4,replace=FALSE))
    y <- map_dbl(df,max)
    x <- min(y)
    x

    A.

    6

    B.

    0

    C.

    1

    D.

    4

20 points   

QUESTION 4

  1. The following R code extracts the unique items in each vector in a list (lst) and stores the new list in lst1. The code uses a for loop.

    lst <- list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE))
    lst1 <- list()
    for(i in 1:length(lst))
    {
    lst1[[i]] <- unique(lst[[i]])
    }
    lst1

    Which of the following options does the same thing as the given R code above ?

    lst <- list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE))
    library(purrr)
    lst1 <- map_int(lst,unique)
    lst1

    lst <- list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE))
    library(purrr)
    lst1 <- map_dbl(lst,unique)
    lst1

    None of the given options

    lst <- list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE))
    library(purrr)
    lst1 <- map(lst,unique)
    lst1

5 points   

Click Save and Submit to save and submit. Click Save All Answers to save all answers.

In: Computer Science

Cruz Company has gathered the information needed to complete its Form 941 for the quarter ended...

Cruz Company has gathered the information needed to complete its Form 941 for the quarter ended September 30, 2019. They are a monthly depositor with the following monthly tax liabilities for this quarter:

July $7,193.10
August 7,000.95
September 7,577.78

State unemployment taxes are only paid to California. The company does not use a third-party designee, the tax returns are signed by the president, Carlos Cruz (Phone: 916-555-9739), and the date filed is October 31, 2019.

Complete Parts 2, 4, and 5 of Form 941 for Cruz Company for the third quarter of 2019.

Name (not your trade name) Employer identification number (EIN)
CARLOS CRUZ 00-0006509
Part 2:   Tell us about your deposit schedule and tax liability for this quarter.
If you are unsure about whether you are a monthly schedule depositor or a semiweekly schedule depositor, see section 11 of Pub. 15.
  16 Check one: b
a.   Line 12 on this return is less than $2,500 or line 12 on the return for the prior quarter was less than $2,500, and you didn't incur a $100,000 next-day deposit obligation during the current quarter. If line 12 for the prior quarter was less than $2,500 but line 12 on this return is $100,000 or more, you must provide a record of your federal tax liability. If you are a monthly schedule depositor, complete the deposit schedule below; if you are a semiweekly schedule depositor, attach Schedule B (Form 941). Go to Part 3.
b.   You were a monthly schedule depositor for the entire quarter. Enter your tax liability for each month and total liability for the quarter, then go to Part 3.
Tax liability: Month 1
Month 2
Month 3
Total liability for quarter Total must equal line 12.
c.   You were a semiweekly schedule depositor for any part of this quarter. Complete Schedule B (Form 941), Report of Tax Liability for Semiweekly Schedule Depositors, and attach it to Form 941.
Part 3:   Tell us about your business. If a question does NOT apply to your business, leave it blank.
  17
If your business has closed or you stopped paying wages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ☐ Check here, and
enter the final date you paid wages / / .
  18 If you are a seasonal employer and you don't have to file a return for every quarter of the year . . . . . . . . . . . . . . . . . ☐ Check here.
Part 4:   May we speak with your third-party designee?
Do you want to allow an employee, a paid tax preparer, or another person to discuss this return with the IRS? See the instructions for details.
No Designee's name and phone number
Select a 5-digit Personal Identification Number (PIN) to use when talking to the IRS.
Part 5:   Sign here. You MUST complete both pages of Form 941 and SIGN it.
Under penalties of perjury, I declare that I have examined this return, including accompanying schedules and statements, and to the best of my knowledge and belief, it is true, correct, and complete. Declaration of preparer (other than taxpayer) is based on all information of which preparer has any knowledge.
Sign your
name here

Carlos Cruz

Print your
name here
Carlos Cruz
Print your
title here
President
Date 10/31/19
Best daytime phone 916-555-9739
  Paid Preparer Use Only Check if you are self-employed . . . . ☐
Preparer's name
PTIN
Preparer's signature
Date
/ /
Firm's name (or yours if self-employed)
EIN
Address
Phone
City
State
ZIP code
Page 2 Form 941 (Rev. 1-2018)
Source: Internal Revenue Service

In: Accounting

Our class has 37 students. i. Without any calculations, what would you guess is the chance...

Our class has 37 students.

i. Without any calculations, what would you guess is the chance that two people in our class share the

same birthday? In other words, do you think it is likely that two people share a birthday?

ii. How many possible pairs of students are there?

iii. What is the probability that any random pair of students has the same birthday?

iv. What is the probability that all of the pairs have different birthdays?

v. So, what is the probability that there is at least one shared birthday in our class?

In: Statistics and Probability

The data set “UCBAdmissions” in R contains admission decisions by gender at six departments of UC...

The data set “UCBAdmissions” in R contains admission decisions by gender at six departments of UC Berkeley. For this data set, carry out appropriate test for independence between the admission decision and gender for each of the departments.

What are your conclusions? Please submit your R script with the answer.

In: Statistics and Probability

Mr. Wimberly engages students in​ small-group work and in​ whole-class instruction. List and explain reasons why...

Mr. Wimberly engages students in​ small-group work and in​ whole-class instruction. List and explain reasons why you think Mr. Wimberly groups students for some activities and not for all​ activities?

In: Psychology

Lung cancer is the second most common cancer among men and women in the USA. You...

Lung cancer is the second most common cancer among men and women in the USA. You are hired as a manager-planner by one of the hospitals. The organization is interested in establishing a community outreach program promoting smoking cessation and lung cancer screening. The Board of Directors requested your services in processing the data collected through the prospective cohort study among male and female population visiting local gym. The data set is attached. Please use Excel or Epi Info to process the data. Chose the correct epi tool, provide a graphic representation of the processed data set and offer a conclusion as to the causative relationship between smoking and death. List the potential biases and provide a recommendation as to the study validity and reliability. Inform the Board of Directors (and your peers) about your findings.

In: Nursing

Create a structure array that contains the following information fields concerning the road bridges in a town

Create a structure array that contains the following information fields concerning the road bridges in a town: bridge location, maximum load (tons), year built, year due for maintenance. Then enter the following data into the array:

Location Max. load Year built Due for maintenance Smith St. Hope Ave. Clark St. North Rd. 80 90 85 100 1928 1950 1933 1960 2011 2013 2012 2012

In: Mechanical Engineering

Preventing the construction of amino acid cross-bridges between peptidoglycan chains is the mechanism of action of...

Preventing the construction of amino acid cross-bridges between peptidoglycan chains is the mechanism of action of the _____________________________ antibacterial drugs.

Question 38 options:

Beta lactams (penicillins)

Aminoglycosides

Imidazoles (Azoles)

Tetracyclines

Nucleotide analogues

In: Biology

Q1: Constraint: Use concept of dynamic allocation for implementation Statement: In a class there are N...

Q1: Constraint:
Use concept of dynamic allocation for implementation


Statement:
In a class there are N students. All of them have appeared for the test. The teacher evaluated
the test and noted marks according to their roll numbers. Marks of each students has to be incremented
by 5. Print list of marks of students before and after increment.

In: Computer Science

The VA-TX Company is going to present a new product in SantaClara,California.In this event,VA-TX will...

The VA-TX Company is going to present a new product in Santa Clara,California.In this event,VA-TX will present a seminar with a coffee break. The auditorium’s capacity is 500 people. The cost of renting the place is $4000/day, utilities included. Moreover, the cost of the food and drinks is $5 per person. After some other experiences, the company knows that 50% of the audience buys its product, which is priced at $75. Is Santa Clara a profitable place to do this kind of campaign? Need the answer in excel form please.

In: Finance