SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: snqProfitEst [ Reply ]
By: Arne Henningsen on 2017-03-12 07:25
[forum:43917]
Hi Kanchana

In the command that defines 'fixnames,' you use 'curly' quotation marks except for the first and last quotation mark, which are 'vertical' quotation marks (that are the correct ones). Hence, object 'fixnames' is a single character string:

> length(fixnames)
[1] 1

which is--of course--not equal to any variable name:

> fixnames %in% names(m)
[1] FALSE

If you use 'vertical' quotation marks:

> fixnames<-c("LarPelP", "DemersP", "OtherP", "MDCra", "ODCra", "OBFCra", "OBTCra", "NMCra", "Harbours", "ICapacity", "IcePlants")

vector 'fixnames' has the expected number of character strings:

> length(fixnames)
[1] 11

and the estimation works.

/Arne

RE: snqProfitEst [ Reply ]
By: Kanchana Wickramasinghe on 2017-03-09 04:03
[forum:43914]

fish2.csv (40) downloads
I am encountering the same problem when I tried to run the model for a different data set. I am getting the following error message.

Error in checkNames(c(priceNames, quantNames, fixNames, instNames), names(data)) :
object(s) 'LarPelP”,“DemersP”, “OtherP”,“MDCra”,“ODCra”,“OBFCra”,“OBTCra”,“NMCra”,“Harbours”,“ICapacity”,“IcePlants' not found

I have given below the codes I used for this and the data file also attached herewith. Appreciate your help to sort out the issue as soon as possible.

Thanks
Kanchana

setwd("")
getwd()
m<-read.csv("fish2.csv", sep=";")
names(m)

library("micEconSNQP")

pricenames<-c("SmaPelP", "WageRate")
quantitynames<-c("QSmaPel","Labor")
fixnames<-c("LarPelP”,“DemersP”, “OtherP”,“MDCra”,“ODCra”,“OBFCra”,“OBTCra”,“NMCra”,“Harbours”,“ICapacity”,“IcePlants")
estResult<-snqProfitEst(pricenames,quantitynames,fixnames,data=m)

RE: snqProfitEst [ Reply ]
By: Kanchana Wickramasinghe on 2016-11-13 12:19
[forum:43679]
Dear Arne,

Thank you so much the advice. It worked when I used that command to import the data file.

Really appreciate!
Kanchana

RE: snqProfitEst [ Reply ]
By: Arne Henningsen on 2016-11-12 07:56
[forum:43678]
Dear Kanchana

In your data set, the values/variables are separated by semicolons (;) rather than by commas (,). If you apply the command 'names(m)' or 'summary(m)', you notice that there is only a single variable in your data set.

Given that the values/variables are separated by semicolons (;) in your data set, you can read/import it with the following command:
m <- read.csv("newrice2.csv",sep=";")

Best regards,
Arne

RE: snqProfitEst [ Reply ]
By: Kanchana Wickramasinghe on 2016-11-11 09:49
[forum:43677]
Following is the error message

Error in checkNames(c(priceNames, quantNames, fixNames, instNames), names(data)) :
object(s) 'fgp', 'Wage', 'prod', 'labq', 'pirri', 'ricep', 'azw', 'sawn' not found.

snqProfitEst [ Reply ]
By: Kanchana Wickramasinghe on 2016-11-11 09:46
[forum:43676]

newrice2.csv (9) downloads
I am trying to estimate supply elasticities using the following programme.

getwd()
m<-read.csv("newrice2.csv",header=TRUE)
library("micEconSNQP")

pricenames<-c("fgp", "Wage")
quantitynames<-c("prod","labq")
fixnames<-c("pirri","envh","drf", "ricep","azw","sawn")

estResult<-snqProfitEst(pricenames,quantitynames,fixnames,data=m)
estResult$ela
estResult$fixEla

It gives the following error message. I checked the variable names and also code several times, but could not find where the error is. Appreciate your help on this.

Data file is attached herewith in csv format.

Thanks
Kanchana

Thanks to:
Vienna University of Economics and Business Powered By FusionForge