coefficients

how do I get individual elements of functions in a list and put them in a matrix in R? [closed]

北城以北 提交于 2021-02-08 10:40:28
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 months ago . Improve this question Edit: Included a sample result I created functions like so: Ex1 = function(a,b,c) 1 * a + 2 * b + 3 * c + 4 Ex2 = function(a,b,c) Ex3 = function(a,b,c) etc.. and put them in a list: exList = list(Ex1,Ex2,Ex3,etc.) now I have to use a function to get the individual elements (

R: Special contrasts within an interaction effect

烂漫一生 提交于 2021-02-07 20:50:46
问题 Within the context of a 2-way ANOVA, I would like to enter contrast levels for one factor (10, 20, 30 degrees) within levels of another factor (SpeciesA, SpeciesB). This assumes the interaction effect is significant so the contrasts cannot simply be done on the temperature main effect. I have attempted to do this within EZanova, multcomp and phia, but have been unable to figure out a syntax that works. Have I missed a package that allows this? Contrast and coefficients Contrast1: Does 10

R: Special contrasts within an interaction effect

给你一囗甜甜゛ 提交于 2021-02-07 20:49:14
问题 Within the context of a 2-way ANOVA, I would like to enter contrast levels for one factor (10, 20, 30 degrees) within levels of another factor (SpeciesA, SpeciesB). This assumes the interaction effect is significant so the contrasts cannot simply be done on the temperature main effect. I have attempted to do this within EZanova, multcomp and phia, but have been unable to figure out a syntax that works. Have I missed a package that allows this? Contrast and coefficients Contrast1: Does 10

mlogit in R - coefficients and unknown random parameter

自作多情 提交于 2020-08-26 07:04:07
问题 I'm trying to run mlogit on my data. My data is: > head(df[c(1:3, 33:45)]) ID Gender Age Option equipment.A equipment.B equipment.C clean.A clean.B clean.C people.A people.B people.C price.A price.B 1 108630 M 56 A 3 3 1 1 3 3 2 3 2 4 3 2 115547 F 34 B 3 3 1 1 3 3 2 3 2 4 3 3 118359 F 51 C 3 3 1 1 3 3 2 3 2 4 3 4 126656 F 40 C 3 3 1 1 3 3 2 3 2 4 3 5 127439 F 26 C 3 3 1 1 3 3 2 3 2 4 3 6 130846 M 69 C 3 3 1 1 3 3 2 3 2 4 3 price.C 1 4 2 4 3 4 4 4 5 4 6 4 My code is: Result <- mlogit.data

How to repeat a process N times?

佐手、 提交于 2020-08-24 03:43:21
问题 I have: x = rnorm(100) # Partie b z = rbinom(100,1,0.60) # Partie c y = 1.4 + 0.7*x - 0.5*z # Partie d x1 = abs(x) y1 = abs(y) Don<-cbind(y1,x1,z) Don1 <- data.frame(Don) Reg <- glm(y1~x1+z,family=poisson(link="log"),Don1) # Partie e #Biais de beta Reg.cf <- coef(Reg) biais0 = Reg.cf[1] - 1.4 biais1 = Reg.cf[2] - 0.7 biais2 = Reg.cf[3] + 0.5 And I need to repeat all this 100 times in order to have different coefficient and calculate the bias and then put the mean of each biais in a text file.

How to repeat a process N times?

北城以北 提交于 2020-08-24 03:43:05
问题 I have: x = rnorm(100) # Partie b z = rbinom(100,1,0.60) # Partie c y = 1.4 + 0.7*x - 0.5*z # Partie d x1 = abs(x) y1 = abs(y) Don<-cbind(y1,x1,z) Don1 <- data.frame(Don) Reg <- glm(y1~x1+z,family=poisson(link="log"),Don1) # Partie e #Biais de beta Reg.cf <- coef(Reg) biais0 = Reg.cf[1] - 1.4 biais1 = Reg.cf[2] - 0.7 biais2 = Reg.cf[3] + 0.5 And I need to repeat all this 100 times in order to have different coefficient and calculate the bias and then put the mean of each biais in a text file.

how to create many linear models at once and put the coefficients into a new matrix?

╄→гoц情女王★ 提交于 2020-01-11 07:51:44
问题 I have 365 columns. In each column I have 60 values. I need to know the rate of change over time for each column (slope or linear coefficient). I created a generic column as a series of numbers from 1:60 to represent the 60 corresponding time intervals. I want to create 356 linear regression models using the generic time stamp column with each of the 365 columns of data. In other words, I have many columns and I would like to create many linear regression models at once, extract the

Extract all individual slope coefficient from pooled OLS estimation in R

橙三吉。 提交于 2020-01-06 06:23:06
问题 I hit a problem where I want to extract all individual coefficient of a particular variable in a pooled regression. My data look like this and I regress Y on X. Observation name date Y X 1 A 1 Y1 X1 2 A 2 Y2 X2 3 B 1 Y3 X3 4 B 2 Y4 X4 Using the plm package and summary, R only gives me one coefficient of X. However, I want to have coefficient of X variable in each individual regression. Can anyone help me with this? To clarify, what I want is all the beta associated with the X_n,1 in the below

Parse Coefficient of an Linear equation

牧云@^-^@ 提交于 2020-01-03 20:14:31
问题 In java i am trying to find the coefficients of a linear equation to find solution of linear equation in my calculator application for example : 3x +2*(6x-3) = 2 -4x what i am dying to get is the coefficients of x and the constant in the form ax+b =0 , in this particular example coefficient = 19 constant = -8 Please suggest a generalized idea 回答1: As already suggested by my comment: This may be arbitrarily complicated, depending on what exactly this parser should support. There are several

How to display coefficients in scientific notation with stargazer

南楼画角 提交于 2019-12-23 07:13:26
问题 I want to compare the results of different models (lm, glm, plm, pglm) in a table in R using stargazer or a similar tool. However I can't find a way to display the coefficients in scientific notation. This is kind of a problem because the intercept is rather large (about a million) while other coefficients are small (about e-7) which results in lots of useless zeros making it harder to read the table. I found a similar question here: Format model display in texreg or stargazer R as scientific