Posts

Module 3 4930

Daniel Tafmizi Dr. Friedman Lis 4930 May 27, 2024 Module 3 # 1: Write a function that takes in a person's name, and prints out a greeting. # list of friends friends = [ "John" , "Michael" , "Oliver" ] # list of greetings greetings = [ "hello [friend], how are you doing." , "Hows the weather treating you [friend]." , "How ya been [friend]." ] # goes through greetings for x in greetings: # goes through friends for y in friends: #replaces [friend] with friends (y) final = x.replace( "[friend]" , y) print (final) # 2: Full name function #function that accepts two objects def full_name (x,y): #Formats result by stripping white space on either end and creates greeting print ( "Hello, " + str .strip(x) + " " + str .strip(y)) full_name( "Daniel" , "Tafmizi" ) full_name( " Doctor " , " Friedman" ) full_name( "Abraha...

Module 2 4930

 Daniel Tafmizi Dr. Friedman Lis 4930 May 27, 2024 Module 2 Assignment:  print ( 'Hello World' ) Hello World String1 = 'Welcome to the Geeks World' print ( "String with the use of Single Quotes: " ) print (String1) String with the use of Single Quotes: Welcome to the Geeks World It seems that the print and string functions work seamlessly. The string function offers a "playground" for modification and structuring. The print function allows the user to use the string in their program. The example above shows a simple use case. String1 holds a string, that is later called in the program. More advanced uses of this can begin handling user data or allow for manipulation techniques. Notes: Run python in cmd - I did not run into much trouble. Initially, I could not link the script file to the cmd. I tried typing "python3" and it directed me to a Microsoft store download. After downloading the MS python, I was able to type "python3" and...

Final Project

Image
Daniel Tafmizi Lis 4273 Dr. Ajani  April 21, 2024 Final Project     My final project uses a World Health Organization data set that tracks weekly deaths and cases (D/C) of Covid 19. I subsetted the United States of America and Canada data rows. I am interested in learning about the  D/C  ratio between the years of each country, as well as the  D/C  ratio between the countries. This offers useful insight into the healthcare and social systems of the countries. Having the  D/C  ratio decrease over time shows that better healthcare and social practices are being implemented. It also acts as a measure of the country's overall healthcare systems.     I will use what I have learned in this class to run Anova analysis on the data. I will detail the process I took as I go along. As a sidenote, it is important I note that the data may have some departures due to local adaptations (WHO). Such as, what they consider a covid death or how they ...

Module 12 Assignment

Image
Daniel Tafmizi Lis 4273 Dr. Ajani  April 6, 2024 Module 12 Assignment Charge<-c(31.9,27,31.3,31,39.4,40.7,42.3,49.5,45,50,50.9,58.5,39.4,36.2,40.5,44.6,46.8,44.7,52.2,54,48.8 ,55.8,58.7,63.4) #creates a list of all charges. Chargetimeseries <-ts(Charge) #the 24 charges are arranged in a time series of 24 values. Chargetimeseries <-ts(Charge, frequency = 12, start=c(2012,1), end = c(2013, 12)) #applies the time span ?ts  Time series function consists of (data, start: natural time unit, frequency: # of obs per time unit) Data is charge, frequency is 12 observations per 1 year, start is 2012 with time unit being 1 year plot(Chargetimeseries)  The visualization shows that there were more charges in 2013 than 2012. Charges tend to increase as the year progresses. We should use Holt-Winters exponential smoothing because we see an increasing trend and seasonality. ?HoltWinters Chargeforecast<-HoltWinters(Chargetimeseries) plot(Chargeforecast) Chargeforecast Holt-Wint...

Module 11 Assignment

Image
Daniel Tafmizi Lis 4273 Dr. Ajani  March 24, 2024 Module 11 Assignment 1. ashina$subject <- factor(1:16)  attach(ashina)  act <- data.frame(vas=vas.active, subject, grp = 2)  plac <-data.frame(vas=vas.plac, subject, grp = 1)    model <- glm(unlist(act)~unlist(plac)) Coefficients: (Intercept) unlist(plac) -13.609 1.236 Degrees of Freedom: 47 Total (i.e. Null); 46 Residual Null Deviance: 95890 Residual Deviance: 61180 AIC: 485.4  plot(model) The model shows us that the active treatment patients responded better than the placebo treatment patients. I wish I could say more, but to be completely honest; I am very confused.  2. a <- gl(2, 2, 8) b <- gl(2, 4, 8) x <-- 1:8 y <- c(1:4, 8:5) z <- rnorm (8) model.matrix(z~a:b) (Intercept) a1:b1 a2:b1 a1:b2 a2:b2 1 1 1 0 0 0 2 1 1 0 0 0 3 1 0 1 0 0 4 1 0 1 ...

Module 10 Assignment

Daniel Tafmizi Lis 4273 Dr. Ajani  March 24, 2024 Module 10 Assignment 9.1.  library(ISwR) data <- (cystfibr) x <- lm(formula = cystfibr$pemax ~ age + weight + bmp + fev1, data=cystfibr) anova(x)          Analysis of Variance Table Response: cystfibr$pemax            Df  Sum Sq Mean Sq F value    Pr(>F)     age        1 10098.5 10098.5 18.4385 0.0003538 *** weight     1   945.2   945.2  1.7258 0.2038195     bmp        1  2379.7  2379.7  4.3450 0.0501483 .   fev1       1  2455.6  2455.6  4.4836 0.0469468 *   Residuals 20 10953.7   547.7    With the given model, we are testing the statistical significance between pemax to the other groups. Given the low P-values, we can say that age and fev1 are significa...