%Fit using polyfit in matlab for best fit checking plot

table = xlsread(‘Project04′,’Stepped-Shaft Torsion Data, A-E’)

[p S] = polyfit(table(:,1),table(:,2),5) Continue reading

%Fit using polyfit in matlab for best fit checking plot

table = xlsread(‘Project04′,’Stepped-Shaft Torsion Data, A-E’)

[p S] = polyfit(table(:,1),table(:,2),5) Continue reading

function A09Prob1_sphereVol_kang401(radius)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% ENGR 132

% Program Description

% The code computes volume of a sphere as a function of height of fluid

% The input to function call is radius

% The function does not return any variable Continue reading

A=imread(‘one.png’)

signImage=rgb2gray(A);

figure(1)

imshow(signImage)

%Detect features of first image that is read above%

signPoints=detectSURFFeatures(signImage)

figure(3)

imshow(signImage)

title(‘100 strongest features from sign image’)

hold on

%Top 100 strongest features

plot(selectStrongest(signPoints,100))

[signFeatures2, signPoints2] = extractFeatures(signImage, signPoints)

B=imread(‘two.png’)

signImage2=rgb2gray(B);

figure(4)

imshow(signImage2)

%Detect features of first image that is read above%

signPoints2=detectSURFFeatures(signImage2)

figure(5)

imshow(signImage2)

title(‘100 strongest features from sign image’)

hold on

%Top 100 strongest features

plot(selectStrongest(signPoints2,300))

[signFeatures2, signPoints2] = extractFeatures(signImage2, signPoints2)

%Punitive point matches in both the images%

picPairs=matchFeatures(signFeatures, signFeatures2);

matchedSignPoints = signPoints(picPairs(:,1),:);

matchedFindPoints = signPoints2(picPairs(:,2),:);

figure(6)

showMatchedFeatures(signImage,signImage2,matchedSignPoints, matchedFindPoints, ‘montage’)

title(‘Matched points both images’)

%Locate objects using Punitive matches%

%[tform, inlierBoxPoints, inlierScenePoints] =estimateGeometricTransform(matchedSignPoints, matchedFindPoints);

%figure;

%showMatchedFeatures(signImage, signImage2, inlierBoxPoints,inlierScenePoints, ‘montage’);

%title(‘Matched Points (Inliers Only)’);

library(readxl)

CSDATA <- read_excel(“CSDATA.xlsx”)

dim(CSDATA)

#Fitting the linear regression on all the independent variables Continue reading

```{r setup, include = FALSE} knitr::opts_chunk$set(echo = TRUE) library(cvTools) #library(glmnet) library(sandwich) Continue reading

#data

Universal_bank = read.csv(“UniversalBank.csv”, header = T)

dim(Universal_bank)

head(Universal_bank) Continue reading

#include <stdlib.h>

#include <stdio.h>

#include <string.h>

#include <ctype.h>

/* Stores parameters that specify how to the program should behave. * Continue reading

import numpy as np print('') print("Enter two numbers, low then high.") l = int(input("low = ")) h = int(input("high = ")) Continue reading

summary_statistics_A <- function(matrix){

vec = sort(as.vector(matrix))

len = length(vec)

if(isSymmetric(matrix) && is.numeric(matrix)){

min = vec[1]

Continue reading

rm(list = ls())

options(warn = -1)

library(readxl)

## Reading the data from excel

Project_2_Data <- read_excel(“Stat 481 Project 2 Data.xls”)

str(Project_2_Data)

## Cleaning and attributing the dtaa

Project_2_Data$courses = as.factor(Project_2_Data$courses)

Project_2_Data$gender = as.factor(Project_2_Data$gender)

levels(Project_2_Data$gender) <- c(“Female”, “Male”)

levels(Project_2_Data$courses) <- c(“Algebra”, “Algebra&Geometry”, “Calculus”)

attach(Project_2_Data)

## Descriptives

library(ggplot2)

library(hrbrthemes)

library(dplyr)

library(tidyr)

library(viridis)

temp = aggregate(score~courses+gender, Project_2_Data, FUN = mean)

qqnorm(score)

ggplot(Project_2_Data, aes(x = score)) + geom_histogram()

summary(Project_2_Data)

p1 <- ggplot(data=Project_2_Data, aes(x=score, fill=courses)) + geom_density(adjust=1.5, alpha=.4) + theme_ipsum()

p2 <- ggplot(data=Project_2_Data, aes(x=score, fill=gender)) + geom_density(adjust=1.5, alpha=.4) + theme_ipsum()

## Model

## Test of normality and other assumptions

ks.test(score, pnorm, mean = mean(score), sd= sd(score))

bartlett.test(score~courses, data = Project_2_Data)

bartlett.test(score~gender, data = Project_2_Data)

## Linear model

model1 = anova(score ~ courses + gender, data = Project_2_Data)

model1

summary(model1)

## Post Hoc

library(DescTools)

PostHocTest(model1, method = “bonferroni”)

PostHocTest(model1, method = “hsd”)

creditDF <- read.csv(“Downloads/Credit.csv”)

str(creditDF)

# Q1)

# Exploratory Data Analysis Continue reading

Solution for Statistics - Supply and Demand Task(a) β̂1 = −0.75317 Confidence interval is: ( −0.8050502, −0.7012837 ) (b) For a variable to be valid instrument for log_p , it should be correlated with log_p but uncorrelated with error term (UI ) Continue reading