ezoic

Sunday, July 29, 2018

differences between t test and z test



                distribution                                            sample size      variance known or unknown
t test       normally distributed                                can be small      unknown
z test      no requirements for normality b/c clt      is large              known

Saturday, July 28, 2018

Odds and odds ratio in statistics

https://stats.idre.ucla.edu/other/mult-pkg/faq/general/faq-how-do-i-interpret-odds-ratios-in-logistic-regression/

The odds of success are defined as the ratio of the probability of success over the probability of failure



confidence interval

https://ncss-wpengine.netdna-ssl.com/wp-content/themes/ncss/pdf/Procedures/PASS/Confidence_Intervals_for_the_Odds_Ratio_in_Logistic_Regression_with_One_Binary_X.pdf


Assumptions of linear models



https://www.theanalysisfactor.com/assumptions-of-linear-models/


  1. The residuals are independent
  2. The residuals are normally distributed
  3. The residuals have a mean of 0 at all values of X
  4. The residuals have constant variance

Data science interview questions




http://alexbraunstein.com/2011/08/09/hire-data-scientist-statistician/



https://www.datasciencecentral.com/profiles/blogs/66-job-interview-questions-for-data-scientists


Apply, sapply, tapply differences in R



https://www.guru99.com/r-apply-sapply-tapply.html

Apply: on matrice

apply(mat,1,var)


1: row,  margin
2:column, margin


lapply: apply on a vector, return a list, no margin

movies <- c("SPYDERMAN","BATMAN","VERTIGO","CHINATOWN")
movies_lower <-lapply(movies, tolower)
[[1]]
[1] "spyderman"
[[2]]
[1]"batman"
...

sapply does the same job as lapply, but return a vector


tapply computes a measure ( min, max, median etc) or a function for each factor variable in a vector.

data(iris)

tapply(iris$Sepal.Width, iris$Species, median)





Wednesday, July 11, 2018

Tuesday, July 10, 2018

Randomly generate user agents and ip in python

1. randomly generate user agent

installation:
pip install fake_useragent

usage:

from fake_useragent import UserAgent

ua=UserAgent()

ua.random

got a random user agent


2. randomly generate ip

'.'.join('%s'%random.randint(0, 255) for i in range(4))



Thursday, July 5, 2018

How to send emails on linux.

I use ubuntu system. How to find out which system you use, command is "uname -a".

I tried to send out email on ubuntu.

I tried on command line first.

I first installed postfix:

sudo apt-get install postfix

Then I tried the command:

echo "test message" | mailx -s "test subject" XXXX@xxx.com

And I got the following:


The program 'mailx' is currently not installed. You can install it by typing:
sudo apt-get install mailutils


So I installed mailx.

I got the message. 

And I put it in a linux shell script. Got it done. 

looking for a man

 I am a mid aged woman.  I was born in 1980. I do not have any kid. no complicated  dating before . I am looking for a man here for marriage...