Find Jobs
Hire Freelancers

python and R code in 10 minutes ( any 2 solution please )

$30-250 USD

Zrušeno
Zveřejněno před více než 11 roky

$30-250 USD

Zaplaceno při doručení
Do all of this in R and Python! Question 2 (20 points) Write a function that calculates the sample covariance between two variables and save it in a separate script file. Here are the values of the two variables: x=[1.1,5.5,7.8,4.2,-2.7,-5.3,8.9] and y=[0.1,1.5,0.8,-4.2,2.7,-9.4,-2.8]. Hint: Define two vectors xv and yv using the values above. Then write a function that has the 2 vectors as inputs. The formula for the sample covariance is: Cov(x,y)=?ni=1(xi-µx)(yi-µy)n-1 . Evaluate the covariance with the two vectors given above in your main program where you need to import the function! This is important, do not define the function in the main script, but write a second file. I need to see whether you know how to import functions that are saved in separate files. Do this in R and Python! Question 3: Data Question (20 points) Go to the following website: [login to view URL] And download the data for: Workforce & Economic Development, 2010. There is a link to an Excel file. Import this dataset into R. If you want to read up on what the various variables mean you can download the code book using the link on top of the page under Longitudinal Data Code Book. Into one figure, make a scatterplot of unempl10 and smallbus10 (add title and axes labels). Below the first graph, make a histogram of unempl10(add title and axes labels). You need to combine both graphs into one figure with a top panel (the scatterplot) and a bottom panel (the histogram). Run a regression that explains the Percent of the Population between age 16-64 that is Unemployed: unempl10 Use numbus10, succbus10, totemp10, smallbus10, comrehab10, and nilf10 as explanatory variables. Predict the unemployment rate using the coefficient estimates from your regression and the average of each explanatory variable as predictors. This may sound more complicated than it is. All you do is you calculate the mean of each explanatory variable and multiply that by the respective coefficient estimate from the regression. Then you add it all up, don't forget to add the intercept in your prediction. Do this in R only! Question 4: Function plotting (20 points) Write a function for: f(x)=?????log(|x|)-xx2/(3-x)if x<0if 0=x<2if 2=x Then use this function and plot it for -5=x=5. Do this in Python only! Question 5: (20 points) Define a matrix A=??1.32453.48-3510.1788?? . Write a loop and using if commands replace all the numbers in the main diagonal (top left to bottom right diagonal) with -5. You need to write a loop or find another automatic way to replace the numbers in the main diagonal. I will not give you points if you simply type A=??-52453.4-5-3610.378-5??. In this exercise you need to demonstrate how to loop over an array and how to use if - statements! Write a loop and replace numbers in the off-diagonal with 100. Again, use a loop and if commands in order to get full points, simply typing the new matrix A=??1.221003.4100-36100788?? will not result in any points.
IČ projektu: 2581532

O projektu

1 nabídka
Vzdálený projekt
Aktivní před 12 roky

Chcete si vydělat nějaké peníze?

Výhody podávání nabídek na Freelancer

Stanovte si rozpočet a časový rámec
Získejte za svou práci zaplaceno
Načrtněte svůj návrh
Registrace a podávání nabídek je zdarma
1 freelanceři nabízejí v průměru $50 USD za tuto práci
Avatar uživatele
Ready to start. We can Question 2 and 5 in Python Easily. We have 2+ years of experience in python. We will take 1-2 days to complete(it is the max) there is 100% possibility that we will complete it before deadline, If you gave us this opportunity we will give you the best product trust us on that
$50 USD v 0 dni
0,0 (0 recenze)
0,0
0,0

O klientovi

Pochází z OMAN
Mutrah, Oman
4,9
359
Ověřená platební metoda
Členem od lis 17, 2009

Ověření klienta

Díky! Poslali jsme vám e-mailem odkaz pro získání kreditu zdarma.
Při odesílání e-mailu se něco pokazilo. Zkuste to prosím znovu.
Registrovaných uživatelů Zveřejněných projektů
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Načítání náhledu
Bylo uděleno povolení ke geolokaci.
Vaše doba přihlášení vypršela a byli jste odhlášeni. Přihlaste se znovu.