regression

How to set up balanced one-way ANOVA for lm()

会有一股神秘感。 提交于 2019-12-22 12:38:53
问题 I have data: dat <- data.frame(NS = c(8.56, 8.47, 6.39, 9.26, 7.98, 6.84, 9.2, 7.5), EXSM = c(7.39, 8.64, 8.54, 5.37, 9.21, 7.8, 8.2, 8), Less.5 = c(5.97, 6.77, 7.26, 5.74, 8.74, 6.3, 6.8, 7.1), More.5 = c(7.03, 5.24, 6.14, 6.74, 6.62, 7.37, 4.94, 6.34)) # NS EXSM Less.5 More.5 # 1 8.56 7.39 5.97 7.03 # 2 8.47 8.64 6.77 5.24 # 3 6.39 8.54 7.26 6.14 # 4 9.26 5.37 5.74 6.74 # 5 7.98 9.21 8.74 6.62 # 6 6.84 7.80 6.30 7.37 # 7 9.20 8.20 6.80 4.94 # 8 7.50 8.00 7.10 6.34 Each column gives data

SPSS: Comparing regression coefficient from multiple models

若如初见. 提交于 2019-12-22 12:31:41
问题 Assuming I have price of houses as the dependent variable and the following as the independent variable: Age Area Floor Time taken to walk to nearest railway station ( time_walk ) Time taken to commute, via train, from the nearest station to the CBD station ( time_train ) Is there a way to compare the coefficient of time_walk given different ranges of time_train . In essence what I would like to achieve is to investigate if people value walking differently, given a change in the mrt traveling

SPSS: Comparing regression coefficient from multiple models

£可爱£侵袭症+ 提交于 2019-12-22 12:30:42
问题 Assuming I have price of houses as the dependent variable and the following as the independent variable: Age Area Floor Time taken to walk to nearest railway station ( time_walk ) Time taken to commute, via train, from the nearest station to the CBD station ( time_train ) Is there a way to compare the coefficient of time_walk given different ranges of time_train . In essence what I would like to achieve is to investigate if people value walking differently, given a change in the mrt traveling

Linear regression, finding slope in MySQL

末鹿安然 提交于 2019-12-22 11:31:22
问题 I'm trying to find the slope of a dataset that has DATETIME as the x axis, and a number on the y axis. I've tried the a number of approaches, and nothing will match the slope of the line when I plug the data into Excel, it's off by multiple orders of magnitude. This is what I have right now, but it's giving me a slope of -1.13e-13 instead of -0.008 SELECT (SUM((x-xBar)*(y-yBar)))/(SUM((x-xBar))*SUM((x-xBar)))) as slope from (select unix_timestamp(date) as x, (select avg(unix_timestamp(date))

R: fix model call in model using as.formula

一个人想着一个人 提交于 2019-12-22 09:18:12
问题 I have a gls model in which I assign a formula (from another object) to the model: equation <- as.formula(aic.obj[row,'model']) > equation temp.avg ~ I(year - 1950) mod1 <- gls(equation, data = dat) > mod1 Generalized least squares fit by maximum likelihood Model: equation Data: dat Log-likelihood: -2109.276 However I do not want the "Model" to be "equation" but rather the quation itself! How do I do this?? 回答1: This is pretty standard, even lm would do this. One approach: hijack the print

StandardScaler with Pipelines and GridSearchCV

自闭症网瘾萝莉.ら 提交于 2019-12-22 09:03:41
问题 I've put standardScaler on the pipeline, and the results of CV_mlpregressor.predict(x_test), are weird. I think i must have to bring the values back from the standardScaler, but still can't figure how. pipe_MLPRegressor = Pipeline([('scaler', StandardScaler()), ('MLPRegressor', MLPRegressor(random_state = 42))]) grid_params_MLPRegressor = [{ 'MLPRegressor__solver': ['lbfgs'], 'MLPRegressor__max_iter': [100,200,300,500], 'MLPRegressor__activation' : ['relu','logistic','tanh'], 'MLPRegressor_

report regression result using stargazer to add separate column for standard error

筅森魡賤 提交于 2019-12-22 08:42:53
问题 i am trying to use stargazer to export my regression result. I wanted to be able to report both coefficient and standard error in separate columns see this pic here: Formatted I wanted to be able to achieve However I can only get coefficient and standard error in the same row using single.row = TRUE. Is there something to achieve the desired result?Thank you so much! My current format 来源: https://stackoverflow.com/questions/52172469/report-regression-result-using-stargazer-to-add-separate

report regression result using stargazer to add separate column for standard error

陌路散爱 提交于 2019-12-22 08:40:03
问题 i am trying to use stargazer to export my regression result. I wanted to be able to report both coefficient and standard error in separate columns see this pic here: Formatted I wanted to be able to achieve However I can only get coefficient and standard error in the same row using single.row = TRUE. Is there something to achieve the desired result?Thank you so much! My current format 来源: https://stackoverflow.com/questions/52172469/report-regression-result-using-stargazer-to-add-separate

“length of 'dimnames' [1] not equal to array extent” error in linear regression summary in r

偶尔善良 提交于 2019-12-22 08:21:02
问题 I'm running a straightforward linear regression model fit on the following dataframe: > str(model_data_rev) 'data.frame': 128857 obs. of 12 variables: $ ENTRY_4 : num 186 218 208 235 256 447 471 191 207 250 ... $ ENTRY_8 : num 724 769 791 777 707 237 236 726 773 773 ... $ ENTRY_12: num 2853 2989 3174 3027 3028 ... $ ENTRY_16: num 2858 3028 3075 2992 3419 ... $ ENTRY_20: num 7260 7188 7587 7560 7165 ... $ EXIT_4 : num 70 82 105 114 118 204 202 99 73 95 ... $ EXIT_8 : num 1501 1631 1594 1576

partial correlation coefficient in pandas dataframe python

二次信任 提交于 2019-12-22 07:59:26
问题 I have a data in pandas dataframe like: df = X1 X2 X3 Y 0 1 2 10 5.077 1 2 2 9 32.330 2 3 3 5 65.140 3 4 4 4 47.270 4 5 2 9 80.570 and I want to do multiple regression analysis. Here Y is dependent variables and x1, x2 and x3 are independent variables. correlation between each independent variables with dependent variable is: df.corr(): X1 X2 X3 Y X1 1.000000 0.353553 -0.409644 0.896626 X2 0.353553 1.000000 -0.951747 0.204882 X3 -0.409644 -0.951747 1.000000 -0.389641 Y 0.896626 0.204882 -0